Commit 0819ef0
committed
Use http.DefaultTransport.Clone() when configuring proxy
When a proxy is configured, a bare http.Transport was created with only
Proxy and optionally TLSClientConfig set. This Transport was missing all
the defaults that http.DefaultTransport provides: TLSHandshakeTimeout,
IdleConnTimeout, MaxIdleConns, ForceAttemptHTTP2, etc.
Without a proxy, the client implicitly uses http.DefaultTransport with
all these defaults. This created inconsistent behavior where proxy
connections had no idle timeout, no TLS handshake timeout, and no HTTP/2
support.
Clone http.DefaultTransport and overlay proxy settings on top so that
proxy and non-proxy paths have equivalent transport behavior.1 parent 3e20037 commit 0819ef0
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
0 commit comments