Skip to content

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

Closed
@EvanMGates

Description

@EvanMGates

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions