diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-08-19 16:30:58 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-08-19 16:30:58 +0200 |
| commit | f81d05226fe61b697baa91e926dd86efad9d8084 (patch) | |
| tree | cf8cdb73a902f2d5dbb3c3d49e8df5d36081556b /internal/http | |
| parent | cda660941ea346d4323858663ff4928f47ee933d (diff) | |
HTTP: Set a default timeout of 5 seconds
Diffstat (limited to 'internal/http')
| -rw-r--r-- | internal/http/http.go | 3 |
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) |
