From f5a91f918ed572f8ccab3eae48c6c3599c353fc1 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Thu, 4 Jan 2024 20:31:17 +0100 Subject: [PATCH] Don't share http roundtripper between clients This seems to fix the issues with concurrency. --- client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index f8f35e6..81cc0d5 100644 --- a/client.go +++ b/client.go @@ -54,7 +54,9 @@ func (o *ClientOpts) withDefaults() *ClientOpts { } if o.HTTPClient == nil { - o.HTTPClient = new(http.Client) + o.HTTPClient = &http.Client{ + Transport: http.DefaultTransport.(*http.Transport).Clone(), + } } if o.MaxRedirects == 0 {