Skip to content
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

Make default VersionNegotiation more conservative #164

Merged
merged 1 commit into from
Feb 6, 2020

Conversation

sagebind
Copy link
Owner

@sagebind sagebind commented Feb 5, 2020

The Upgrade header that can be used for insecure upgrade from HTTP/1.x to HTTP/2 is not handled properly by many in-production HTTP servers and can result in an error when the request would otherwise succeed without the Upgrade header.

Since there's not really any way for us to know if an error response was caused by our Upgrade header or not (and what the server state is for non-idempotent methods), VersionNegotiation::latest_compatible will no longer send this header, and instead rely exclusively on the server to explicitly declare higher HTTP versions that it supports, either via ALPN or something else.

Fixes #159.

The `Upgrade` header that can be used for insecure upgrade from HTTP/1.x to HTTP/2 is not handled properly by many in-production HTTP servers and can result in an error when the request would otherwise succeed without the `Upgrade` header.

Since there's not really any way for us to know if an error response was caused by our `Upgrade` header or not (and what the server state is for non-idempotent methods), `VersionNegotiation::latest_compatible` will no longer send this header, and instead rely exclusively on the server to explicitly _declare_ higher HTTP versions that it supports, either via ALPN or something else.

Fixes #159.
@sagebind sagebind merged commit d10045a into master Feb 6, 2020
@sagebind sagebind deleted the 159-http2-upgrade-defaults branch February 6, 2020 05:39
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.

Upgrade headers break HTTP to HTTPS redirects
1 participant