use http.DefaultClient (#2530)

default client already handles proxy
This commit is contained in:
Michael Yang
2024-02-20 15:34:47 -08:00
committed by GitHub
parent 4613a080e7
commit 897b213468
3 changed files with 9 additions and 52 deletions

View File

@@ -1103,18 +1103,7 @@ func makeRequest(ctx context.Context, method string, requestURL *url.URL, header
req.ContentLength = contentLength
}
proxyURL, err := http.ProxyFromEnvironment(req)
if err != nil {
return nil, err
}
client := http.Client{
Transport: &http.Transport{
Proxy: http.ProxyURL(proxyURL),
},
}
resp, err := client.Do(req)
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}