Skip to content

Commit 4573d53

Browse files
authored
Clone from default HTTP transport to prevent issues with zeroed values (#161)
1 parent 728f761 commit 4573d53

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

sysdig/internal/client/secure/client.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,9 @@ func WithExtraHeaders(client SysdigSecureClient, extraHeaders map[string]string)
7373

7474
func NewSysdigSecureClient(sysdigSecureAPIToken string, url string, insecure bool) SysdigSecureClient {
7575
httpClient := retryablehttp.NewClient()
76-
httpClient.HTTPClient = &http.Client{
77-
Transport: &http.Transport{
78-
TLSClientConfig: &tls.Config{InsecureSkipVerify: insecure},
79-
Proxy: http.ProxyFromEnvironment,
80-
},
81-
}
76+
transport := http.DefaultTransport.(*http.Transport).Clone()
77+
transport.TLSClientConfig = &tls.Config{InsecureSkipVerify: insecure}
78+
httpClient.HTTPClient = &http.Client{Transport: transport}
8279

8380
return &sysdigSecureClient{
8481
SysdigSecureAPIToken: sysdigSecureAPIToken,

0 commit comments

Comments
 (0)