Skip to content

Commit 187cb02

Browse files
Use cloned http.DefaultTransport. issue-1857 (#1885)
* fix: use cloned http.DefaultTransport. issue-1857 Signed-off-by: Karthik Kondapally <kondapally9@gmail.com> * fix lint issue Signed-off-by: Karthik Kondapally <kondapally9@gmail.com> * restore older construction of Default Transport and add additional variables Signed-off-by: Karthik Kondapally <kondapally9@gmail.com> --------- Signed-off-by: Karthik Kondapally <kondapally9@gmail.com>
1 parent 343ae65 commit 187cb02

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

api/client.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,18 @@ import (
2727
)
2828

2929
// DefaultRoundTripper is used if no RoundTripper is set in Config.
30+
// refer https://github.com/golang/go/blob/master/src/net/http/transport.go#L46
3031
var DefaultRoundTripper http.RoundTripper = &http.Transport{
3132
Proxy: http.ProxyFromEnvironment,
3233
DialContext: (&net.Dialer{
3334
Timeout: 30 * time.Second,
3435
KeepAlive: 30 * time.Second,
3536
}).DialContext,
36-
TLSHandshakeTimeout: 10 * time.Second,
37+
ForceAttemptHTTP2: true,
38+
MaxIdleConns: 100,
39+
IdleConnTimeout: 90 * time.Second,
40+
TLSHandshakeTimeout: 10 * time.Second,
41+
ExpectContinueTimeout: 1 * time.Second,
3742
}
3843

3944
// Config defines configuration parameters for a new client.

0 commit comments

Comments
 (0)