Skip to content

Commit

Permalink
net/http2: fix erringRoundTripper
Browse files Browse the repository at this point in the history
The http transport added a new interface to detect RoundTrippers that
always error. Prior to this, the erringRoundTripper would not be
identified as such and a new connection was always created.

Updates golang/go#40213

Change-Id: Icc315dcc9ce8ea0db94a1f2c58c6a741675d8962
Reviewed-on: https://go-review.googlesource.com/c/net/+/243257
Reviewed-by: Chris Friesen <[email protected]>
Reviewed-by: Emmanuel Odeke <[email protected]>
Run-TryBot: Emmanuel Odeke <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
fraenkel authored and odeke-em committed Aug 22, 2020
1 parent 3edf25e commit c890458
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions http2/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -2525,6 +2525,7 @@ func strSliceContains(ss []string, s string) bool {

type erringRoundTripper struct{ err error }

func (rt erringRoundTripper) RoundTripErr() error { return rt.err }
func (rt erringRoundTripper) RoundTrip(*http.Request) (*http.Response, error) { return nil, rt.err }

// gzipReader wraps a response body so it can lazily
Expand Down

0 comments on commit c890458

Please sign in to comment.