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

net/http: changing Transport.Dial to DialContext opts in to HTTP/2 #27011

Open
EvanMGates opened this Issue Aug 15, 2018 · 3 comments

Comments

Projects
None yet
5 participants
@EvanMGates

EvanMGates commented Aug 15, 2018

What did you do?

We changed http.Client from using the deprecated transport.Dial function to its replacement, transport.DialContext.

What did you expect to see?

Dial and DialContext should behave similarly when using the same parameters.

What did you see instead?

Using DialContext causes Transport to be configured for http/2. The custom dialer DialContext should not automatically enable http2 as specified in the comment at https://github.com/golang/go/blob/go1.10/src/net/http/transport.go#L228.

Does this issue reproduce with the latest release (go1.10.3)?

We noticed this issue in Go 1.10.2 and the offending code hasn't changed in Go 1.10.3.

System details

We deploy our code on linux/amd64.

We will submit a patch for this issue shortly.

@andybons andybons added this to the Unplanned milestone Aug 16, 2018

@andybons

This comment has been minimized.

Member

andybons commented Aug 16, 2018

@bradfitz bradfitz added the NeedsFix label Aug 16, 2018

@bradfitz bradfitz modified the milestones: Unplanned, Go1.12 Aug 16, 2018

@gopherbot

This comment has been minimized.

gopherbot commented Aug 21, 2018

Change https://golang.org/cl/130256 mentions this issue: net/http: restrict automatic HTTP/2 transport when using DialContext

@riking

This comment has been minimized.

riking commented Aug 26, 2018

I thought this was specified in reverse, that using Dial instead of DialContext blocks the use of h2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment