Remove accidental caching from repo list and other commands
Any gh command that has invoked NewCachedHTTPClient has also inadvertently enabled caching for the original `http.Client` due to the nature that NewCachedHTTPClient mutates the original argument passed.
This commit is contained in:
parent
7b7929bb6b
commit
c22a85e2b5
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue