envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Proxy wasm set http response body when original response does not have a body

Open dragosc28 opened this issue 3 years ago • 2 comments

Seems that the on_http_response_body callback is not called when the original response does not include a body. Because of this, I don't see a way of setting a different body, except for using send_http_response from a different callback.

Should the api trigger the callback with body_size = 0 in this case?

dragosc28 avatar Sep 20 '22 11:09 dragosc28

cc @mpwarres

kyessenov avatar Sep 20 '22 17:09 kyessenov

The on_http_response_headers callback should already give clear signal as to whether or not a body is expected, via the end_of_stream bool param. If end_of_stream == true, then the plugin shouldn't expect an on_http_response_body callback; IMO that would be a little surprising, since the on_http_response_headers callback already indicated the stream ended.

A plugin should be able to call send_http_response from the on_http_response_headers callback in cases like this. That could be warranted anyways, to allow changing of the HTTP response code for the response.

mpwarres avatar Sep 20 '22 22:09 mpwarres

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 21 '22 00:10 github-actions[bot]

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

github-actions[bot] avatar Oct 28 '22 04:10 github-actions[bot]