From dae31bb0192e6b519111d3cb80ddd4312cda306c Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 25 May 2020 20:33:06 +0200 Subject: 'Exec' as an alternative to 'Url' --- internal/http/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/http/client.go') 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 { -- cgit v1.2.3-54-g00ecf