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

x/net/http2: scheme is hardcoded to https #17257

Closed
ayanamist opened this issue Sep 28, 2016 · 2 comments
Closed

x/net/http2: scheme is hardcoded to https #17257

ayanamist opened this issue Sep 28, 2016 · 2 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@ayanamist
Copy link

ayanamist commented Sep 28, 2016

https://github.com/golang/net/blob/f09c4662a0bd6bd8943ac7b4931e185df9471da4/http2/transport.go#L1049
Here scheme is hardcoded to https, but for #15830 the scheme may be http, so the request received by h2c server has wrong scheme.
When using with a http2 proxy, this leads to a wrong request, GET http://www.example.com becomes GET https://www.example.com when remote proxy server received, and wrong content is fetced.

@bradfitz bradfitz added this to the Unreleased milestone Sep 28, 2016
@bradfitz bradfitz added the Suggested Issues that may be good for new contributors looking for work to do. label Sep 28, 2016
@bradfitz
Copy link
Contributor

I have a full plate and am not prioritizing any non-https features or fixes in the http2 package, but somebody else can take this bug.

@ayanamist
Copy link
Author

@bradfitz I fix it and add some test.
https://go-review.googlesource.com/29975
Do you know who can review it?

@golang golang locked and limited conversation to collaborators Sep 29, 2017
c3mb0 pushed a commit to c3mb0/net that referenced this issue Apr 2, 2018
The existing implementation has a hardcoded "https" scheme for
all request, since it allows http scheme in the request, it should
use the scheme in the request url.

Fixes golang/go#17257

Change-Id: Ibd9528df0328d7630ee94a006db694645625cdc9
Reviewed-on: https://go-review.googlesource.com/29975
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

3 participants