Skip to content

Commit

Permalink
golang#457 clone request context too
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferdy Pruis committed Oct 1, 2021
1 parent 2bc19b1 commit d2ed32b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func cloneRequest(r *http.Request) *http.Request {
// shallow copy of the struct
r2 := new(http.Request)
*r2 = *r
r2 = r2.WithContext(r.Context())
// deep copy of the Header
r2.Header = make(http.Header, len(r.Header))
for k, s := range r.Header {
Expand Down

0 comments on commit d2ed32b

Please sign in to comment.