Unverified Commit 7050a847 authored by k8s-ci-robot's avatar k8s-ci-robot Committed by GitHub

Merge pull request #70789 from seunghunee/roundtrip-bugfix

Fix e2e conformance test error
parents 1777be5f c0cacd25
...@@ -4320,13 +4320,13 @@ func (rt *extractRT) RoundTrip(req *http.Request) (*http.Response, error) { ...@@ -4320,13 +4320,13 @@ func (rt *extractRT) RoundTrip(req *http.Request) (*http.Response, error) {
// headersForConfig extracts any http client logic necessary for the provided // headersForConfig extracts any http client logic necessary for the provided
// config. // config.
func headersForConfig(c *restclient.Config) (http.Header, error) { func headersForConfig(c *restclient.Config, url *url.URL) (http.Header, error) {
extract := &extractRT{} extract := &extractRT{}
rt, err := restclient.HTTPWrappersForConfig(c, extract) rt, err := restclient.HTTPWrappersForConfig(c, extract)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if _, err := rt.RoundTrip(&http.Request{}); err != nil { if _, err := rt.RoundTrip(&http.Request{URL: url}); err != nil {
return nil, err return nil, err
} }
return extract.Header, nil return extract.Header, nil
...@@ -4350,7 +4350,7 @@ func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []st ...@@ -4350,7 +4350,7 @@ func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []st
url.Host += ":80" url.Host += ":80"
} }
} }
headers, err := headersForConfig(config) headers, err := headersForConfig(config, url)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to load http headers: %v", err) return nil, fmt.Errorf("failed to load http headers: %v", err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment