From 2b5dc2b80195673724820361613b91ef316837fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jules=20Cast=C3=A9ran?= Date: Mon, 5 Feb 2024 14:25:48 +0100 Subject: [PATCH] fix: use default http transport (#1992) --- scw/client.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scw/client.go b/scw/client.go index 01f3fa79a..b5dc7a378 100644 --- a/scw/client.go +++ b/scw/client.go @@ -6,7 +6,6 @@ import ( "fmt" "io" "math" - "net" "net/http" "reflect" "strconv" @@ -546,13 +545,8 @@ func newVariableFromType(t interface{}) interface{} { func newHTTPClient() *http.Client { return &http.Client{ - Timeout: 30 * time.Second, - Transport: &http.Transport{ - DialContext: (&net.Dialer{Timeout: 5 * time.Second}).DialContext, - TLSHandshakeTimeout: 5 * time.Second, - ResponseHeaderTimeout: 30 * time.Second, - MaxIdleConnsPerHost: 20, - }, + Timeout: 30 * time.Second, + Transport: http.DefaultTransport.(*http.Transport).Clone(), } }