Commit 3d066789 authored by Matt Holt's avatar Matt Holt

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

proxy: Allow mixed case Upgrade headers (WebSocket fix)
parents 462128cd 1a9f7002
...@@ -207,7 +207,7 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request, extr ...@@ -207,7 +207,7 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request, extr
return err 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() res.Body.Close()
hj, ok := rw.(http.Hijacker) hj, ok := rw.(http.Hijacker)
if !ok { if !ok {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment