fix ws authorization bug (#2059)

This commit is contained in:
zryfish
2020-05-12 16:08:05 +08:00
committed by GitHub
parent dcd341e70f
commit 1d48ca3446

View File

@@ -47,6 +47,7 @@ func WithKubeAPIServer(handler http.Handler, config *rest.Config, failed proxy.E
// make sure we don't override kubernetes's authorization
req.Header.Del("Authorization")
httpProxy := proxy.NewUpgradeAwareHandler(&s, defaultTransport, true, false, failed)
httpProxy.UpgradeTransport = proxy.NewUpgradeRequestRoundTripper(defaultTransport, defaultTransport)
httpProxy.ServeHTTP(w, req)
return
}