Skip to content

Commit 5a6ca86

Browse files
authored
fix: Respect proxy env vars in common HTTP client (#149)
* Respect proxy env vars in common HTTP client * Implement review comments, use default http transport * Use tabs instead of spaces
1 parent 63e0c9d commit 5a6ca86

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sysdig/internal/client/common/client.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ func WithExtraHeaders(client SysdigCommonClient, extraHeaders map[string]string)
2828

2929
func NewSysdigCommonClient(sysdigAPIToken string, url string, insecure bool) SysdigCommonClient {
3030
client := retryablehttp.NewClient()
31+
transport := http.DefaultTransport.(*http.Transport).Clone()
32+
transport.TLSClientConfig = &tls.Config{InsecureSkipVerify: insecure}
33+
3134
client.HTTPClient = &http.Client{
32-
Transport: &http.Transport{
33-
TLSClientConfig: &tls.Config{InsecureSkipVerify: insecure},
34-
},
35+
Transport: transport,
3536
}
3637

3738
return &sysdigCommonClient{

0 commit comments

Comments
 (0)