Skip to content

Commit c890458

Browse files
fraenkelodeke-em
authored andcommitted
net/http2: fix erringRoundTripper
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]>
1 parent 3edf25e commit c890458

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

http2/transport.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,6 +2525,7 @@ func strSliceContains(ss []string, s string) bool {
25252525

25262526
type erringRoundTripper struct{ err error }
25272527

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

25302531
// gzipReader wraps a response body so it can lazily

0 commit comments

Comments
 (0)