aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/omithttp2.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-01-27 16:35:28 -0800
committerIan Lance Taylor <iant@golang.org>2020-01-29 04:04:52 +0000
commitc436eadbc36704012be727457f464d8fbf950638 (patch)
treee6c5ddf32ec191e14eca1d0d2ff222ecb234c09e /src/net/http/omithttp2.go
parenta6701d81a04bc84b5851e104b27783395a348832 (diff)
downloadgo-c436eadbc36704012be727457f464d8fbf950638.tar.xz
net/http: don't treat an alternate protocol as a known round tripper
As of CL 175857, the client code checks for known round tripper implementations, and uses simpler cancellation code when it finds one. However, this code was not considering the case of a request that uses a user-defined protocol, where the user-defined protocol was registered with the transport to use a different round tripper. The effect was that round trippers that worked with earlier releases would not see the expected cancellation semantics with tip. Fixes #36820 Change-Id: I60e75b5d0badcfb9fde9d73a966ba1d3f7aa42b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/216618 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/net/http/omithttp2.go')
-rw-r--r--src/net/http/omithttp2.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/net/http/omithttp2.go b/src/net/http/omithttp2.go
index a0b33e9aad..307d93a3b1 100644
--- a/src/net/http/omithttp2.go
+++ b/src/net/http/omithttp2.go
@@ -36,6 +36,10 @@ type http2erringRoundTripper struct{}
func (http2erringRoundTripper) RoundTrip(*Request) (*Response, error) { panic(noHTTP2) }
+type http2noDialH2RoundTripper struct{}
+
+func (http2noDialH2RoundTripper) RoundTrip(*Request) (*Response, error) { panic(noHTTP2) }
+
type http2noDialClientConnPool struct {
http2clientConnPool http2clientConnPool
}