net/http: Allow upgrading connections even if DisableKeepAlives is set #36381
Comments
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jan 4, 2020
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jan 4, 2020
Change https://golang.org/cl/213277 mentions this issue: |
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jan 6, 2020
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jan 7, 2020
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jan 7, 2020
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jan 7, 2020
Fixes golang#36381 If one was using http.Transport with DisableKeepAlives and trying to upgrade a connection against net/http's Server, the Server would not allow a "Connection: Upgrade" header to be written and instead override it to "Connection: Close" which would break the handshake. This commit ensures net/http's Server does not override the connection header for successful protocol switch responses.
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jan 7, 2020
Fixes golang#36381 If one was using http.Transport with DisableKeepAlives and trying to upgrade a connection against net/http's Server, the Server would not allow a "Connection: Upgrade" header to be written and instead override it to "Connection: Close" which would break the handshake. This commit ensures net/http's Server does not override the connection header for successful protocol switch responses.
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jan 7, 2020
Fixes golang#36381 If one was using http.Transport with DisableKeepAlives and trying to upgrade a connection against net/http's Server, the Server would not allow a "Connection: Upgrade" header to be written and instead override it to "Connection: Close" which would break the handshake. This commit ensures net/http's Server does not override the connection header for successful protocol switch responses.
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jan 9, 2020
Fixes golang#36381 If one was using http.Transport with DisableKeepAlives and trying to upgrade a connection against net/http's Server, the Server would not allow a "Connection: Upgrade" header to be written and instead override it to "Connection: Close" which would break the handshake. This commit ensures net/http's Server does not override the connection header for successful protocol switch responses.
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jan 9, 2020
Fixes golang#36381 If one was using http.Transport with DisableKeepAlives and trying to upgrade a connection against net/http's Server, the Server would not allow a "Connection: Upgrade" header to be written and instead override it to "Connection: Close" which would break the handshake. This commit ensures net/http's Server does not override the connection header for successful protocol switch responses.
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jun 12, 2020
Fixes golang#36381 If one was using http.Transport with DisableKeepAlives and trying to upgrade a connection against net/http's Server, the Server would not allow a "Connection: Upgrade" header to be written and instead override it to "Connection: Close" which would break the handshake. This commit ensures net/http's Server does not override the connection header for successful protocol switch responses.
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jun 12, 2020
Fixes golang#36381 If one was using http.Transport with DisableKeepAlives and trying to upgrade a connection against net/http's Server, the Server would not allow a "Connection: Upgrade" header to be written and instead override it to "Connection: Close" which would break the handshake. This commit ensures net/http's Server does not override the connection header for successful protocol switch responses.
nhooyr
added a commit
to nhooyr/go
that referenced
this issue
Jun 12, 2020
Fixes golang#36381 If one was using http.Transport with DisableKeepAlives and trying to upgrade a connection against net/http's Server, the Server would not allow a "Connection: Upgrade" header to be written and instead override it to "Connection: Close" which would break the handshake. This commit ensures net/http's Server does not override the connection header for successful protocol switch responses.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the http transport has DisableKeepAlives enabled, then connection upgrading does not work. See nhooyr/websocket#185
If DisableKeepAlives is set, then the client sets
Connection: close
on every request which is completely fine.The problem is that when the server encounters such a request, it prevents any http.Handler from setting the
Connection
header.See
go/src/net/http/server.go
Line 1293 in 3a6cd4c
If that is changed to:
Then everything works fine.
The text was updated successfully, but these errors were encountered: