diff options
Diffstat (limited to '')
-rw-r--r-- | internal/http/client.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/http/client.go b/internal/http/client.go index c9af26e..230c333 100644 --- a/internal/http/client.go +++ b/internal/http/client.go @@ -35,7 +35,7 @@ func init() { unsafeClient = &http.Client{Transport: transport} } -func context(timeout int) (ctxt.Context, ctxt.CancelFunc) { +func Context(timeout int) (ctxt.Context, ctxt.CancelFunc) { return ctxt.WithTimeout(ctxt.Background(), time.Duration(timeout)*time.Second) } @@ -50,7 +50,7 @@ var noop ctxt.CancelFunc = func() {} func Get(url string, timeout int, disableTLS bool) (resp *http.Response, cancel ctxt.CancelFunc, err error) { prematureExit := true - ctx, ctxCancel := context(timeout) + ctx, ctxCancel := Context(timeout) cancel = func() { if resp != nil { |