Skip to content

Commit

Permalink
Fix http.DefaultClient (#1278)
Browse files Browse the repository at this point in the history
We do not want to modify `http.DefaultClient` because
it can cause undesired effects in other places.

Signed-off-by: Mikalai Radchuk <[email protected]>
  • Loading branch information
m1kola authored Sep 17, 2024
1 parent d144146 commit 06424ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/catalogmetadata/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ func TestFilesystemCache(t *testing.T) {
cacheDir := t.TempDir()
tt.tripper.content = make(fstest.MapFS)
maps.Copy(tt.tripper.content, tt.contents)
httpClient := http.DefaultClient
httpClient.Transport = tt.tripper
httpClient := &http.Client{
Transport: tt.tripper,
}
c := cache.NewFilesystemCache(cacheDir, func() (*http.Client, error) {
return httpClient, nil
})
Expand Down

0 comments on commit 06424ef

Please sign in to comment.