Merge pull request #107606 from xens/feat/propagate_req_context_into_proxyreq

feat: propagate req context into proxyReq
This commit is contained in:
Kubernetes Prow Robot 2022-01-18 12:02:22 -08:00 committed by GitHub
commit 40055e45a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}