Skip to content

Commit

Permalink
Apply options before we return for custom http
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Feb 28, 2021
1 parent 98872d1 commit fff655a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,20 @@ func createClient(options *ClientOptions, customHTTPClient *http.Client) (c *Cli
// Create a client
c = new(Client)

// Set options (either default or user modified)
if options == nil {
options = DefaultClientOptions()
}

// Set the options
c.Options = options

// Is there a custom HTTP client to use?
if customHTTPClient != nil {
c.httpClient = customHTTPClient
return
}

// Set options (either default or user modified)
if options == nil {
options = DefaultClientOptions()
}

// dial is the net dialer for clientDefaultTransport
dial := &net.Dialer{KeepAlive: options.DialerKeepAlive, Timeout: options.DialerTimeout}

Expand All @@ -194,9 +197,6 @@ func createClient(options *ClientOptions, customHTTPClient *http.Client) (c *Cli
TLSHandshakeTimeout: options.TransportTLSHandshakeTimeout,
}

// Set the options
c.Options = options

// Determine the strategy for the http client
if options.RequestRetryCount <= 0 {

Expand Down

0 comments on commit fff655a

Please sign in to comment.