@@ -100,15 +100,13 @@ func (ep *Endpoint) ClientOpts() ([]client.Opt, error) {
100100 )
101101
102102 } else {
103- httpClient := & http.Client {
104- // No tls
105- // No proxy
106- Transport : & http.Transport {
107- DialContext : helper .Dialer ,
108- },
109- }
110103 result = append (result ,
111- client .WithHTTPClient (httpClient ),
104+ client .WithHTTPClient (& http.Client {
105+ // No TLS, and no proxy.
106+ Transport : & http.Transport {
107+ DialContext : helper .Dialer ,
108+ },
109+ }),
112110 client .WithHost (helper .Host ),
113111 client .WithDialContext (helper .Dialer ),
114112 )
@@ -125,8 +123,7 @@ func withHTTPClient(tlsConfig *tls.Config) func(*client.Client) error {
125123 // Use the default HTTPClient
126124 return nil
127125 }
128-
129- httpClient := & http.Client {
126+ return client .WithHTTPClient (& http.Client {
130127 Transport : & http.Transport {
131128 TLSClientConfig : tlsConfig ,
132129 DialContext : (& net.Dialer {
@@ -135,8 +132,7 @@ func withHTTPClient(tlsConfig *tls.Config) func(*client.Client) error {
135132 }).DialContext ,
136133 },
137134 CheckRedirect : client .CheckRedirect ,
138- }
139- return client .WithHTTPClient (httpClient )(c )
135+ })(c )
140136 }
141137}
142138
0 commit comments