Skip to content

Translating HTTP1 to orig-proto H2 with illegal H2 headers will fail the request #1407

@seanmonstar

Description

@seanmonstar

The proxy currently will always strip connection, and any headers that header mentions (so, connection: upgrade will mean both connection and upgrade are removed). However, there are a couple of other headers which are considered to apply at the connection level and thus are illegal in HTTP2 that won't be removed. This results in an h2 user error, and will mean the request fails with a 500.

These headers are:

  • connection
  • transfer-encoding
  • proxy-connection
  • upgrade
  • keep-alive

The connection (and its related headers) are already handled, and there's a fix for transfer-encoding, but proxy-connection (and upgrade or keep-alive that somehow aren't named in a connection header) will make it by, and result in a failed request internally. Some possible solutions:

  • Increase the list of headers which are always stripped for all HTTP/1 requests. This is the least complex.
  • When doing the orig-proto upgrade, remove the extra headers and put synthetic replacements with new names, which are then translated back into the originals. This way preserves some of these headers, but I'm not convinced they actually should be at all, and is more complex.
  • Make requests with these headers not eligible for orig-proto translation. This seems unfortunate, but would be more compatible and less complex than the translation option.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions