Skip to content

Commit de2f283

Browse files
authored
Merge pull request from GHSA-5pf6-2qwx-pxm2
Avoid modifying the DefaultClient's Transport
2 parents 67e3899 + c5f8d9d commit de2f283

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

v2/protocol/http/protocol.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ func New(opts ...Option) (*Protocol, error) {
102102
}
103103

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

108111
if p.roundTripper != nil {

0 commit comments

Comments
 (0)