Skip to content

Commit 8cd0920

Browse files
switheknhooyr
authored andcommitted
Improve http client copying
1 parent 199a4e8 commit 8cd0920

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

dial.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ func (opts *DialOptions) cloneWithDefaults() *DialOptions {
5959
ctx, cancel = context.WithTimeout(ctx, opts.HTTPClient.Timeout)
6060
defer cancel()
6161

62-
opts.HTTPClient = &http.Client{
63-
Transport: opts.HTTPClient.Transport,
64-
CheckRedirect: opts.HTTPClient.CheckRedirect,
65-
Jar: opts.HTTPClient.Jar,
66-
}
62+
newClient := *opts.HTTPClient
63+
newClient.Timeout = 0
64+
opts.HTTPClient = &newClient
6765
}
6866
if o.HTTPHeader == nil {
6967
o.HTTPHeader = http.Header{}

0 commit comments

Comments
 (0)