Unverified Commit f35b7a36 authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #73046 from mikkeloscar/fix-e2e-websocket-https

Fix websocket e2e tests for https endpoints
parents 42b7bb1c 9f34d8bc
...@@ -4226,16 +4226,10 @@ func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []st ...@@ -4226,16 +4226,10 @@ func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []st
if err != nil { if err != nil {
return nil, fmt.Errorf("Failed to create tls config: %v", err) return nil, fmt.Errorf("Failed to create tls config: %v", err)
} }
if tlsConfig != nil { if url.Scheme == "https" {
url.Scheme = "wss" url.Scheme = "wss"
if !strings.Contains(url.Host, ":") {
url.Host += ":443"
}
} else { } else {
url.Scheme = "ws" url.Scheme = "ws"
if !strings.Contains(url.Host, ":") {
url.Host += ":80"
}
} }
headers, err := headersForConfig(config, url) headers, err := headersForConfig(config, url)
if err != nil { if err != nil {
......
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