Fix conformance test error with log level 8

Fix: #70788
e2e conformance test completely passed with log level 5,
but failed only with log level 8.
This commit is contained in:
seunghunee 2018-11-08 08:04:36 +00:00 committed by Shin Seunghun
parent 16d0992534
commit c0cacd2525

View File

@ -4302,13 +4302,13 @@ func (rt *extractRT) RoundTrip(req *http.Request) (*http.Response, error) {
// headersForConfig extracts any http client logic necessary for the provided
// config.
func headersForConfig(c *restclient.Config) (http.Header, error) {
func headersForConfig(c *restclient.Config, url *url.URL) (http.Header, error) {
extract := &extractRT{}
rt, err := restclient.HTTPWrappersForConfig(c, extract)
if err != nil {
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 extract.Header, nil
@ -4332,7 +4332,7 @@ func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []st
url.Host += ":80"
}
}
headers, err := headersForConfig(config)
headers, err := headersForConfig(config, url)
if err != nil {
return nil, fmt.Errorf("failed to load http headers: %v", err)
}