Move validation of connection headers in HTTP/2 back to HpackDecoder
#12982
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.
Motivation:
#12755 added validation for presence of connection-related headers while
HpackDecoder
decodes the incoming frame. Then #12832 moved this validation fromHpackDecoder
toDefaultHttp2Headers
. As the result, existing use-case that could useDefaultHttp2Headers
for HTTP/2 and HTTP/1.X broke when users add any of the mentioned prohibited headers. The HTTP/1.X to HTTP/2 translation logic usually has sanitization process that removes connection-related headers. It's enough to run this validation only for incoming messages and we should preserve backward compatibility for 4.1.Modifications:
isConnectionHeader
andte
validations fromDefaultHttp2Headers
back toHpackDecoder
;HpackDecoder
fails incoming headers as expected;DefaultHttp2Headers
;Result:
Backward compatibility is preserved, while validation for connection-related headers is done in
HpackDecoder
.Backport of #12975.