Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[http1 codec] Allow requests with Transfer-Encoding and Content-Length headers set. #12349
Changes from 2 commits
886c5f0
6572594
8cc229c
542e6e3
b59bcea
ac88d96
7c91d03
0cd4cb7
4a88b62
4119c78
e1f3801
f4776d6
3870fda
db56f66
e9f2f1f
c7424f0
9815afb
e6c38f5
004dc2a
de444cc
af435ca
9efa4e2
9bbc964
43e18a1
09b9b11
1fbb0f8
02a98d4
57a8b1f
5f13f37
b082ee4
4102c14
467e7d0
984b394
ff024e7
ac60a70
cfcfc35
97e7828
536f724
ee525a0
ac1d0e1
2549c62
62ef94a
85864ec
bd9d235
c959d58
8cf9af0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Sorry why this uses_transfer_encoding check? Couldn't you just do
(parser_.flags & F_CHUNKED)
? Or you are checking for any transfer encoding? Can you add more comments?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.
I was following RFC here (any TE, not only
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.
This seems not right. Why are we now returning a 501 here?
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.
onHeadersCompleteBase checks for unsupported encodings (
identity
in this case) and returns 501 if unsupported encoding is detected.if everything is ok - passes control to onHeadersComplete() where my code is executed.
I can refactor it to do CL/TE checks before TE encoding check which returns 501, I'm not sure which order is correct in this 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.
nginx's response in case of unsupported encoding and CL set:
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.
Naively it seems like we should return a 4xx code here, but I'm not an expert. If this is what NGINX does that seems fine, thanks.
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.
OK I see by allowing this in the parser we get slightly different behavior here. I think this is OK but I think we should release note this also and I would also like to hear from @antoniovicente or @PiotrSikora on this.
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.
Friendly ping on the release note on the subtle behavior change here.
/wait
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.
4xx makes more sense to me in this case.
This specific change seems unrelated to the rest of the functional changes in this PR, I would suggest doing the http_parser version bump separately from the rest of this PR.
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.
I can split this PR in two, one for library update and one for functional change.
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.
@veshij correct me if I'm wrong, but I don't think this has to do with the library update. It has to do with the fact that we are now hitting code for this case that we did not hit before, and Envoy is returning 501 when it used to return 400. Right? If so I think this seems OK to me with a release note but will defer to @antoniovicente and @PiotrSikora on that.
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.
@mattklein123 Sorry, that was a reply to comment ^