summaryrefslogtreecommitdiff
path: root/internal/http/http.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-08-19 16:30:58 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-08-19 16:30:58 +0200
commitf81d05226fe61b697baa91e926dd86efad9d8084 (patch)
treecf8cdb73a902f2d5dbb3c3d49e8df5d36081556b /internal/http/http.go
parentcda660941ea346d4323858663ff4928f47ee933d (diff)
HTTP: Set a default timeout of 5 seconds
Diffstat (limited to 'internal/http/http.go')
-rw-r--r--internal/http/http.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/http/http.go b/internal/http/http.go
index 3c8e4e1..ae791a9 100644
--- a/internal/http/http.go
+++ b/internal/http/http.go
@@ -7,6 +7,7 @@ import (
"net/http"
"net/url"
"strings"
+ "time"
"github.com/jwijenbergh/eduvpn-common/internal/types"
)
@@ -91,7 +92,7 @@ func HTTPMethodWithOpts(method string, url string, opts *HTTPOptionalParams) (ht
}
// Create a client
- client := &http.Client{}
+ client := &http.Client{Timeout: 5 * time.Second}
errorMessage := fmt.Sprintf("failed HTTP request with method %s and url %s", method, url)