aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/net.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pkg/net.go')
-rw-r--r--internal/pkg/net.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/pkg/net.go b/internal/pkg/net.go
index 519a9b0f..09ad7fa0 100644
--- a/internal/pkg/net.go
+++ b/internal/pkg/net.go
@@ -1,6 +1,7 @@
package pkg
import (
+ "context"
"crypto/sha512"
"errors"
"io"
@@ -45,8 +46,13 @@ func (c *Cache) NewHTTP(hc *http.Client, req *http.Request, checksum Checksum) F
// NewHTTPGet returns a new [File] backed by the supplied client. A GET request
// is set up for url. If c is nil, [http.DefaultClient] is used instead.
-func (c *Cache) NewHTTPGet(hc *http.Client, url string, checksum Checksum) (File, error) {
- req, err := http.NewRequest(http.MethodGet, url, nil)
+func (c *Cache) NewHTTPGet(
+ ctx context.Context,
+ hc *http.Client,
+ url string,
+ checksum Checksum,
+) (File, error) {
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
if err != nil {
return nil, err
}