mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #73046 from mikkeloscar/fix-e2e-websocket-https
Fix websocket e2e tests for https endpoints
This commit is contained in:
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
Block a user