Skip to content

Commit

Permalink
fix: copy DefaultTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Sep 21, 2024
1 parent 7c74858 commit 431c74b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,19 @@ func (c *Client) GetWithHeaders(
) (error, query_info.QueryInfo) {
url := fmt.Sprintf("%s%s", c.host, relativeURL)

client := &http.Client{Timeout: c.timeout}
var transport http.RoundTripper

transportRaw, ok := http.DefaultTransport.(*http.Transport)
if ok {
transport = transportRaw.Clone()
} else {
transport = http.DefaultTransport
}

client := &http.Client{
Timeout: c.timeout,
Transport: transport,
}
start := time.Now()
queryInfo := query_info.QueryInfo{
Success: false,
Expand Down

0 comments on commit 431c74b

Please sign in to comment.