Skip to content

Commit

Permalink
Merge pull request #10 from blackbx/fix-nil-pointer-dereference
Browse files Browse the repository at this point in the history
Set transport to be http.Default transport
  • Loading branch information
alistairjudson committed Feb 6, 2020
2 parents ace462d + 3603a19 commit c806e4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions httpclient/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ type Params struct {

// New creates a new instance of an *http.Client
func New(params Params) *http.Client {
client := http.DefaultClient
transport := http.DefaultTransport
for _, tripper := range params.Trippers {
client.Transport = tripper(client.Transport)
transport = tripper(transport)
}
client := http.DefaultClient
client.Transport = transport
return client
}

0 comments on commit c806e4a

Please sign in to comment.