mirror of https://github.com/k3s-io/k3s
Merge pull request #73046 from mikkeloscar/fix-e2e-websocket-https
Fix websocket e2e tests for https endpointspull/564/head
commit
f35b7a365e
|
@ -4226,16 +4226,10 @@ func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []st
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to create tls config: %v", err)
|
||||
}
|
||||
if tlsConfig != nil {
|
||||
if url.Scheme == "https" {
|
||||
url.Scheme = "wss"
|
||||
if !strings.Contains(url.Host, ":") {
|
||||
url.Host += ":443"
|
||||
}
|
||||
} else {
|
||||
url.Scheme = "ws"
|
||||
if !strings.Contains(url.Host, ":") {
|
||||
url.Host += ":80"
|
||||
}
|
||||
}
|
||||
headers, err := headersForConfig(config, url)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue