]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.15] net/http: fix detection of Roundtrippers that always error
authorMichael Fraenkel <michael.fraenkel@gmail.com>
Fri, 17 Jul 2020 03:30:12 +0000 (21:30 -0600)
committerDmitri Shuralyov <dmitshur@golang.org>
Mon, 29 Mar 2021 15:50:54 +0000 (15:50 +0000)
commitbe872812063f29e9c0d280fb37289d40330d96db
tree2563ee28f10121309996041631e61c1e01469a81
parent69b943102868747ff2b62d9ada02c464d9984aef
[release-branch.go1.15] net/http: fix detection of Roundtrippers that always error

CL 220905 added code to identify alternate transports that always error
by using http2erringRoundTripper. This does not work when the transport
is from another package, e.g., http2.erringRoundTripper.
Expose a new method that allow detection of such a RoundTripper.
Switch to an interface that is both a RoundTripper and can return the
underlying error.

Fixes #45076.
Updates #40213.

Change-Id: I170739857ab9e99dffb5fa55c99b24b23c2f9c54
Reviewed-on: https://go-review.googlesource.com/c/go/+/243258
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/304210
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
src/net/http/omithttp2.go
src/net/http/transport.go