Skip to content

Commit

Permalink
fix: copy default transport + add cmd tests (#78)
Browse files Browse the repository at this point in the history
* chore: add cmd tests

* chore: fixed linting

* chore: fix tests
  • Loading branch information
freak12techno authored Sep 21, 2024
1 parent de8a668 commit b5298a0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkg/http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,20 @@ func (c *Client) GetInternal(
queryType constants.QueryType,
headers map[string]string,
) (io.ReadCloser, error) {
client := &http.Client{Timeout: 10 * time.Second}
var transport http.RoundTripper

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

client := &http.Client{
Timeout: 10 * time.Second,
Transport: transport,
}

start := time.Now()

fullURL := c.Host + url
Expand Down

0 comments on commit b5298a0

Please sign in to comment.