Skip to content

Commit

Permalink
Merge pull request from GHSA-5pf6-2qwx-pxm2
Browse files Browse the repository at this point in the history
Avoid modifying the DefaultClient's Transport
  • Loading branch information
duglin committed Mar 6, 2024
2 parents 67e3899 + c5f8d9d commit de2f283
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion v2/protocol/http/protocol.go
Expand Up @@ -102,7 +102,10 @@ func New(opts ...Option) (*Protocol, error) {
}

if p.Client == nil {
p.Client = http.DefaultClient
// This is how http.DefaultClient is initialized. We do not just use
// that because when WithRoundTripper is used, it will change the client's
// transport, which would cause that transport to be used process-wide.
p.Client = &http.Client{}
}

if p.roundTripper != nil {
Expand Down

0 comments on commit de2f283

Please sign in to comment.