Skip to content

feat: add knob to customise on{Request,Response}Headers StopIteration behavior #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 13, 2025

Conversation

mpwarres
Copy link
Contributor

@mpwarres mpwarres commented Jul 11, 2025

Add protected ContextBase::allow_on_headers_stop_iteration_ field that can be used by host implementations to control whether or not ContextBase propagates FilterHeaderStatus::StopIteration returned by onRequestHeaders() or onResponseHeaders() without modification.

Follow-on envoyproxy/envoy#40213 adds an option in Envoy WasmFilter PluginConfig that sets the value of this field.

For details, see Envoy Wasm / Proxy-Wasm support for FilterHeadersStatus::StopIteration. This PR is one part of implementing Option B: WasmFilter config knob.

Note that default behavior of proxy-wasm-cpp-host and ContextBase is unchanged.

@mpwarres mpwarres force-pushed the request-headers-stop-iteration branch from 3ec2095 to 02239af Compare July 11, 2025 20:57
It was testing the same case twice.

Signed-off-by: Michael Warres <[email protected]>
Copy link
Contributor

@martijneken martijneken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but please fix the option name

Rename option to allow_on_headers_stop_iteration and test onResponseHeaders
behavior as well.

Signed-off-by: Michael Warres <[email protected]>
@mpwarres
Copy link
Contributor Author

LGTM but please fix the option name

Thanks for catching that--done.

@mpwarres mpwarres changed the title feat: add knob to customise onRequestHeaders StopIteration behavior feat: add knob to customise on{Request,Response}Headers StopIteration behavior Jul 12, 2025
Copy link
Contributor

@martijneken martijneken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

mpwarres added 4 commits July 12, 2025 16:16
Signed-off-by: Michael Warres <[email protected]>
Previously, the test was creating a new wasm_handle and plugin_handle for each
request, which led to the WasmHandleBase destructor calling
wasm_base_->startShutdown() mid-test. Apparently V8 tolerates this, but WAMR
(correctly) does not.

Signed-off-by: Michael Warres <[email protected]>
@mpwarres mpwarres merged commit 7a212bc into proxy-wasm:main Jul 13, 2025
30 checks passed
@mpwarres mpwarres deleted the request-headers-stop-iteration branch July 13, 2025 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants