From a5e41daaa46032b833fe34edf901ab977612be9c Mon Sep 17 00:00:00 2001 From: Romain Aviolat Date: Mon, 17 Jan 2022 15:52:40 +0100 Subject: [PATCH] feat: propagate req context into proxyReq Goal of this commit is to propagate req context into proxyReq so it propagates to proxyClientConn.Do. This change is linked to PR #105632 --- .../apimachinery/pkg/util/httpstream/spdy/roundtripper.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go b/staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go index 086e4bcf0b9..b92e7a65b7b 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go @@ -173,12 +173,14 @@ func (s *SpdyRoundTripper) dial(req *http.Request) (net.Conn, error) { Host: targetHost, } + proxyReq = *proxyReq.WithContext(req.Context()) + if pa := s.proxyAuth(proxyURL); pa != "" { proxyReq.Header = http.Header{} proxyReq.Header.Set("Proxy-Authorization", pa) } - proxyDialConn, err := s.dialWithoutProxy(req.Context(), proxyURL) + proxyDialConn, err := s.dialWithoutProxy(proxyReq.Context(), proxyURL) if err != nil { return nil, err }