check server response instead of client

This commit is contained in:
Austin 2015-06-01 19:29:32 -07:00
parent ccd3e55b32
commit 68cd4bdeab

View File

@ -147,7 +147,7 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request, extr
}
defer res.Body.Close()
if res.StatusCode == http.StatusSwitchingProtocols && outreq.Header.Get("Upgrade") == "websocket" {
if res.StatusCode == http.StatusSwitchingProtocols && res.Header.Get("Upgrade") == "websocket" {
hj, ok := rw.(http.Hijacker)
if !ok {
return nil