Commit 471e452
committed
wasm: add config setting to control StopIteration behavior (#40213)
Add PluginConfig.allow_on_headers_stop_iteration config field to control
the behavior of WasmFilter when plugin onRequestHeaders and
onResponseHeaders callbacks return a value of
FilterHeadersStatus::StopIteration.
If allow_on_headers_stop_iteration is false (the default), then in cases
where a Wasm plugin onRequestHeaders or onResponseHeaders callback
returns FilterHeadersStatus::StopIteration, WasmFilter will maintain its
current behavior of translating that response code to
FilterHeadersStatus::StopAllIterationAndWatermark.
If allow_on_headers_stop_iteration is true, then WasmFilter will avoid
any translation of FilterHeadersStatus::StopIteration, and will pass it
through to HCM unmodified, which allows Wasm plugins to inspect request
or response body data before deciding how to handle/transform request or
response headers.
For details, see [Envoy Wasm / Proxy-Wasm support for
FilterHeadersStatus::StopIteration](https://docs.google.com/document/d/1Whd1C0k-H2NHrPOmlAqqauFz6ObSTP017juJIYyciB0/edit?usp=sharing).
This PR implements [Option B: WasmFilter config
knob](https://docs.google.com/document/d/1Whd1C0k-H2NHrPOmlAqqauFz6ObSTP017juJIYyciB0/edit?tab=t.0#bookmark=id.5wxldlapsp54),
building on proxy-wasm/proxy-wasm-cpp-host#434.
Note that this config knob is a stopgap until upcoming v0.3.0 of the
Proxy-Wasm ABI adds more comprehensive support for StopIteration and
body buffering, per proxy-wasm/spec#63.
Additional Description:
This change updates the proxy-wasm-cpp-host dependency since it depends
on proxy-wasm/proxy-wasm-cpp-host#434, which was
recently merged there.
Signed-off-by: Michael Warres <mpw@google.com>
Mirrored from https://github.com/envoyproxy/envoy @ 274d68f02971c1cf0da1628991126e8ebd307d251 parent 5485f23 commit 471e452
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | | - | |
| 152 | + | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| |||
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
195 | 200 | | |
196 | 201 | | |
197 | 202 | | |
| |||
0 commit comments