-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[http1 codec] Allow requests with Transfer-Encoding and Content-Length headers set. #12349
Conversation
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks for tackling this - I'm sure someone else down the line is going to have traffic which hits this unusual corner case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for driving this forward. A few comments.
/wait
/assign @antoniovicente |
Signed-off-by: Oleg Guba <[email protected]>
/wait |
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
/wait |
Signed-off-by: Oleg Guba <[email protected]>
/wait |
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this LGTM. Will give @PiotrSikora @htuch some more time to take a look again if they want. @antoniovicente is out till Monday so all things being equal I would prefer to wait for him to get back to take a final look. cc @asraa also for the H1 codec error handling changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from my end - just two minor nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked at changes since my last set of comments. Thanks for adding tests for the response cases.
@@ -1086,7 +1086,8 @@ bool ClientConnectionImpl::cannotHaveBody() { | |||
ASSERT(!pending_response_done_); | |||
return true; | |||
} else if (parser_.status_code == 204 || parser_.status_code == 304 || | |||
(parser_.status_code >= 200 && parser_.content_length == 0)) { | |||
(parser_.status_code >= 200 && parser_.content_length == 0 && | |||
!(parser_.flags & F_CHUNKED))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity: what coverage do we have for 1xx responses that include content-length or transfer-encoding: chunked headers?
…e code to use it Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
/wait |
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
Signed-off-by: Oleg Guba <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks LGTM. @antoniovicente @alyssawilk any further comments?
…h headers set. (envoyproxy#12349) opt-in for serving requests/responses with Content-Length and Transfer-Encoding: chunked. Per RFC remove Content-Length header before forwarding it to upstream. Signed-off-by: Oleg Guba <[email protected]> Signed-off-by: Clara Andrew-Wani <[email protected]>
When would this PR get into envoyproxy/envoy-wasm so that istio can pick it up? We are actually hitting this edge case. @alyssawilk |
Up to folks on that side. |
@alyssawilk we won't be able to test this until this version of envoyproxy gets into istio and then into our IBM managed istio offering. |
Commit Message: [http1 codec] Allow HTTP/1 requests/responses with Transfer-Encoding and Content-Length headers set.
Additional Description: opt-in for serving requests/responses with Content-Length and Transfer-Encoding: chunked. Per RFC remove Content-Length header before forwarding it to upstream.
Update http-parser version to include fix for nodejs/http-parser#517.
Risk Level: Medium
Testing: unit tests, update integration test
Docs Changes: updated docs/root/version_history/current.rst
Release Notes: http: added allow_chunked_length configuration option for HTTP/1 codec to allow processing requests with both Content-Length and Transfer-Encoding: chunked. If enabled - per RFC Content-Length is removed before sending to upstream.
Fixes #11398