Use clone of http.Transport defaults

This commit is contained in:
Ingo Oppermann
2023-07-07 11:23:41 +02:00
parent ccecbe3c8e
commit 97121f3ca5
4 changed files with 18 additions and 18 deletions

View File

@@ -369,10 +369,9 @@ func (c *APIClient) call(method, path, contentType string, data io.Reader, origi
func (c *APIClient) request(req *http.Request) (int, io.ReadCloser, error) {
if c.Client == nil {
tr := &http.Transport{
MaxIdleConns: 10,
IdleConnTimeout: 30 * time.Second,
}
tr := http.DefaultTransport.(*http.Transport).Clone()
tr.MaxIdleConns = 10
tr.IdleConnTimeout = 30 * time.Second
c.Client = &http.Client{
Transport: tr,