Skip to content

Commit

Permalink
Ensure request context is preserved when copying request
Browse files Browse the repository at this point in the history
  • Loading branch information
Stein Fletcher committed Jun 3, 2021
1 parent ca34185 commit df6bcff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func CopyRequest(request *http.Request) *http.Request {
ContentLength: request.ContentLength,
RemoteAddr: request.RemoteAddr,
}
resCopy = resCopy.WithContext(request.Context())

if request.Body != nil {
bodyBytes, _ := ioutil.ReadAll(request.Body)
Expand Down

0 comments on commit df6bcff

Please sign in to comment.