-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
HTTP/1.1 connection upgraded to HTTP/2 has old cowboy_req:version/1 #1613
Comments
Good catch, but tough one. The request is HTTP/1.1 so I think we want to keep that around (for example for logs). Only the response is HTTP/2. Perhaps we need a token |
As a workaround for the time being you can check the Connection/Upgrade/HTTP2-Settings header to identify that the upgrade was requested. |
@essen I think I interpret the
is that it is What you decide is fine. I am not going to work-around it (don't like extra parsing of the Connection/Upgrade/HTTP2-Settings header stuff) because no one has complained about the problem yet. I will just wait for what exists in the future, unless someone complains. |
Well the request's version is HTTP/1.1, it is only the response that is HTTP/2. The request's version is HTTP/1.1, it's not changing afterwards. So either we have a special token, or a second field identifying the protocol used in the response. A separate field likely makes more sense. But I need to think about it for a while. The problem doesn't occur in Websocket because we don't provide the Req after the Websocket upgrade, only before when we are still HTTP/1.1. |
When using cowboy 2.10.0, a HTTP/1.1 connection that gets upgraded to HTTP/2 doesn't have its cowboy_req:version/1 data updated after the upgrade (i.e.,
'HTTP/1.1'
is returned instead of the expected'HTTP/2'
). Certain response headers are invalid for HTTP/2 use (based on curl use) likeX-Content-Type-Options
andX-XSS-Protection
, so it is best to be aware of the current protocol used for the HTTP response headers. The version could be changed to'HTTP/2'
incowboy_http:http2_upgrade/4
orcowboy_http2:init/12
.A way to replicate this problem is with CloudI/CloudI@f279724 using:
Using the curl argument
--http2-prior-knowledge
instead of--http2
doesn't cause this error, due to initiating the connection as HTTP/2 (no HTTP/1.1 upgrade occurs).The text was updated successfully, but these errors were encountered: