-
Notifications
You must be signed in to change notification settings - Fork 18k
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
x/net/http2/h2c: handler does not support http.ResponseController #71999
Comments
cc @neild @tombergan |
see #46319, hijack doesn't make sense for http2. |
@seankhliao, I'm not sure what you mean by that. https://cs.opensource.google/go/x/net/+/refs/tags/v0.35.0:http2/h2c/h2c.go;l=137 Unless I'm misreading something, this line clearly blocks |
Alternative: Let's just deprecate the h2c package. Go 1.24's net/http has direct support for unencrypted HTTP/2 connections (https://pkg.go.dev/net/http#Protocols.SetUnencryptedHTTP2) and there's no longer any good reason to keep this package around. Filed proposal for that: https://go.dev/issue/72039 |
(Reopening this issue, though, because if we do want to keep the h2c package around, @ainar-g is right that it should use ResponseController to do the hijack.) |
ah I misread it as a hijack from a handler wrapped by h2c |
Change https://go.dev/cl/655615 mentions this issue: |
Go version
go version go1.23.6 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Use a custom
http.ResponseWriter
that has theUnwrap() http.ResponseWriter
method withh2c.NewHandler
.What did you see happen?
The handler didn't work properly, and with the
GODEBUG=http2debug=2
env I see:What did you expect to see?
The handler to work; the h2c handler to use http.NewResponseController to hijack a connection.
The text was updated successfully, but these errors were encountered: