From d2ed32bd61c4c3fb70a0288fb08687a30c39c6a9 Mon Sep 17 00:00:00 2001 From: Ferdy Pruis Date: Mon, 30 Nov 2020 16:56:49 +0100 Subject: [PATCH] #457 clone request context too --- transport.go | 1 + 1 file changed, 1 insertion(+) diff --git a/transport.go b/transport.go index 90657915f..7453d2142 100644 --- a/transport.go +++ b/transport.go @@ -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 {