Skip to content

Commit

Permalink
#146 address transport override part
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed Apr 20, 2018
1 parent a7a5353 commit dcac3e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions client.go
Expand Up @@ -845,6 +845,10 @@ func (c *Client) getTLSConfig() (*tls.Config, error) {
// returns `*http.Transport` currently in use or error
// in case currently used `transport` is not an `*http.Transport`
func (c *Client) getTransport() (*http.Transport, error) {
if c.httpClient.Transport == nil {
c.SetTransport(new(http.Transport))
}

if transport, ok := c.httpClient.Transport.(*http.Transport); ok {
return transport, nil
}
Expand Down
3 changes: 0 additions & 3 deletions default.go
Expand Up @@ -296,9 +296,6 @@ func createClient(hc *http.Client) *Client {
// Log Prefix
c.SetLogPrefix("RESTY ")

// Default transport
c.SetTransport(&http.Transport{})

// Default redirect policy
c.SetRedirectPolicy(NoRedirectPolicy())

Expand Down

0 comments on commit dcac3e6

Please sign in to comment.