Skip to content

Commit

Permalink
fix: copy DefaultTransport (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno authored Sep 21, 2024
1 parent 7c74858 commit 5f1cd79
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 5f1cd79

Please sign in to comment.