mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Allow mixed case Upgrade headers
Caddy expects websocket to be completely lowercase. Some applications send websocket upgrade headers like the following: `Upgrade: WebSocket` This change allows all variations of websocket.
This commit is contained in:
parent
462128cd80
commit
1a9f700287
1 changed files with 1 additions and 1 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue