Skip to content

Remove connection-specific header fields from HTTP/2 responses - #1208

Open
arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:h2-response-connection-headers-v2
Open

arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:h2-response-connection-headers-v2

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

RFC 9113, section 8.2.2 does not allow Connection, Proxy-Connection, Keep-Alive, Transfer-Encoding or Upgrade in 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 to Constants so 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant