diff --git a/api/http_client.go b/api/http_client.go index 9ea6ca1fb..634559508 100644 --- a/api/http_client.go +++ b/api/http_client.go @@ -60,8 +60,9 @@ func NewHTTPClient(opts HTTPClientOptions) (*http.Client, error) { } func NewCachedHTTPClient(httpClient *http.Client, ttl time.Duration) *http.Client { - httpClient.Transport = AddCacheTTLHeader(httpClient.Transport, ttl) - return httpClient + newClient := *httpClient + newClient.Transport = AddCacheTTLHeader(httpClient.Transport, ttl) + return &newClient } // AddCacheTTLHeader adds an header to the request telling the cache that the request