Skip to content

Commit 9cbd683

Browse files
authored
refactor: do not modify http.DefaultClient (#53)
change suggested by Cursor while reviewing the code assisted-by: Cursor Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
1 parent 0fee90c commit 9cbd683

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

internal/argocd/argocd_client.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ type Client struct {
2020
}
2121

2222
func NewClient(host string, token string, insecure bool) *Client {
23-
cl := http.DefaultClient
23+
// When Transport is nil, the client uses http.DefaultTransport and does not mutate global state.
24+
cl := &http.Client{}
2425
if insecure {
2526
cl.Transport = &http.Transport{
2627
TLSClientConfig: &tls.Config{
27-
InsecureSkipVerify: insecure, //nolint:gosec
28+
InsecureSkipVerify: true, //nolint:gosec
2829
},
2930
}
3031
}

0 commit comments

Comments
 (0)