Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2021-02-03 08:51:49 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-02-08 02:52:07 +0300
commit9504871174848d6c3f47c6ba1d89899d1cd6c7f1 (patch)
tree05efc1f52a20e2691cdd95289a97396e59b09730 /internal/vfs/zip/archive.go
parent4f07314b781e387183b29dff7d7ad62b9c111f26 (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/vfs/zip/archive.go')
-rw-r--r--internal/vfs/zip/archive.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/vfs/zip/archive.go b/internal/vfs/zip/archive.go
index 9826cdd6..981881c0 100644
--- a/internal/vfs/zip/archive.go
+++ b/internal/vfs/zip/archive.go
@@ -119,7 +119,7 @@ func (a *zipArchive) readArchive(url string) {
ctx, cancel := context.WithTimeout(context.Background(), a.openTimeout)
defer cancel()
- a.resource, a.err = httprange.NewResource(ctx, url)
+ a.resource, a.err = httprange.NewResource(ctx, url, a.fs.httpClient)
if a.err != nil {
metrics.ZipOpened.WithLabelValues("error").Inc()
return