diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-02-03 08:51:49 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-02-08 02:52:07 +0300 |
commit | 9504871174848d6c3f47c6ba1d89899d1cd6c7f1 (patch) | |
tree | 05efc1f52a20e2691cdd95289a97396e59b09730 /internal/httprange/resource_test.go | |
parent | 4f07314b781e387183b29dff7d7ad62b9c111f26 (diff) |
Refactor http client usage in httprage
Moves the http.Client initialization inside the `httprange` package to
the zip VFS. This makes the type `Resource` depend on an http.Client
that needs to be passed on initialization.
It also makes the zip VFS initialize the client. It's possible to
reconfigure it to register a file protocol by calling vfs.Reconfigure
explicitly.
Diffstat (limited to 'internal/httprange/resource_test.go')
-rw-r--r-- | internal/httprange/resource_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/httprange/resource_test.go b/internal/httprange/resource_test.go index 1d6481fc..6b1d9c72 100644 --- a/internal/httprange/resource_test.go +++ b/internal/httprange/resource_test.go @@ -91,7 +91,7 @@ func TestNewResource(t *testing.T) { })) defer testServer.Close() - got, err := NewResource(context.Background(), testServer.URL+tt.url) + got, err := NewResource(context.Background(), testServer.URL+tt.url, testClient) if tt.expectedErrMsg != "" { require.Error(t, err) require.Contains(t, err.Error(), tt.expectedErrMsg) |