summaryrefslogtreecommitdiff
path: root/internal/http
diff options
context:
space:
mode:
Diffstat (limited to 'internal/http')
-rw-r--r--internal/http/http.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/http/http.go b/internal/http/http.go
index 4d8f3bc..ba081fd 100644
--- a/internal/http/http.go
+++ b/internal/http/http.go
@@ -147,8 +147,11 @@ type Client struct {
}
// Returns a HTTP client with some default settings
-func NewClient() *Client {
- c := &http.Client{}
+func NewClient(client *http.Client) *Client {
+ c := client
+ if c == nil {
+ c = &http.Client{}
+ }
// ReadLimit denotes the maximum amount of bytes that are read in HTTP responses
// This is used to prevent servers from sending huge amounts of data
// A limit of 16MB, although maybe much larger than needed, ensures that we do not run into problems