Repository navigation
Remove connection-specific header fields from HTTP/2 responses - #1208
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
RFC 9113, section 8.2.2 forbids an endpoint from generating HTTP/2 messages that contain Connection, Proxy-Connection, Keep-Alive, Transfer-Encoding or Upgrade, and clients such as curl reject a response that does. Requests were already checked, but an application that set one of these header fields on the response had it sent unchanged. Remove them in StreamProcessor.prepareHeaders() and share the list with the request check by moving it to Constants.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
RFC 9113, section 8.2.2 does not allow
Connection,Proxy-Connection,Keep-Alive,Transfer-EncodingorUpgradein an HTTP/2 message. Requests are already checked, but an application that set one of these header fields on a response had it sent unchanged, and clients such as curl reject the response.This removes them in
StreamProcessor.prepareHeaders()and moves the list toConstantsso the request check and the response code share it.Tested with a running Tomcat and curl over HTTP/2: without the change curl fails with
Invalid HTTP header field was received ... [connection], with the change the response is received. HTTP/1.1 is not affected.