Merge pull request #713 from 5an1ty/patch-1

proxy: Allow mixed case Upgrade headers (WebSocket fix)
This commit is contained in:
Matt Holt 2016-04-03 14:30:32 -06:00
commit 3d066789d3

View file

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