diff --git a/dial.go b/dial.go index 849515e88080a6df564ad743cb91cc3e28a8e173..509882e0806dd8f4c3cfdd3b58fbb73e0e07be8b 100644 --- a/dial.go +++ b/dial.go @@ -79,11 +79,9 @@ func dial(ctx context.Context, urls string, opts *DialOptions, rand io.Reader) ( ctx, cancel = context.WithTimeout(ctx, opts.HTTPClient.Timeout) defer cancel() - opts.HTTPClient = &http.Client{ - Transport: opts.HTTPClient.Transport, - CheckRedirect: opts.HTTPClient.CheckRedirect, - Jar: opts.HTTPClient.Jar, - } + newClient := *opts.HTTPClient + newClient.Timeout = 0 + opts.HTTPClient = &newClient } if opts.HTTPHeader == nil {