mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-02 14:17:01 +01:00
caddyhttp: use strings.EqualFold (#2413)
This commit is contained in:
parent
f92a3aa0e5
commit
7fe9e13fbf
1 changed files with 2 additions and 2 deletions
|
@ -329,7 +329,7 @@ func (rp *ReverseProxy) ServeHTTP(rw http.ResponseWriter, outreq *http.Request,
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
isWebsocket := res.StatusCode == http.StatusSwitchingProtocols && strings.ToLower(res.Header.Get("Upgrade")) == "websocket"
|
isWebsocket := res.StatusCode == http.StatusSwitchingProtocols && strings.EqualFold(res.Header.Get("Upgrade"), "websocket")
|
||||||
|
|
||||||
// Remove hop-by-hop headers listed in the
|
// Remove hop-by-hop headers listed in the
|
||||||
// "Connection" header of the response.
|
// "Connection" header of the response.
|
||||||
|
@ -702,7 +702,7 @@ func (tlsHandshakeTimeoutError) Temporary() bool { return true }
|
||||||
func (tlsHandshakeTimeoutError) Error() string { return "net/http: TLS handshake timeout" }
|
func (tlsHandshakeTimeoutError) Error() string { return "net/http: TLS handshake timeout" }
|
||||||
|
|
||||||
func requestIsWebsocket(req *http.Request) bool {
|
func requestIsWebsocket(req *http.Request) bool {
|
||||||
return strings.ToLower(req.Header.Get("Upgrade")) == "websocket" && strings.Contains(strings.ToLower(req.Header.Get("Connection")), "upgrade")
|
return strings.EqualFold(req.Header.Get("Upgrade"), "websocket") && strings.Contains(strings.ToLower(req.Header.Get("Connection")), "upgrade")
|
||||||
}
|
}
|
||||||
|
|
||||||
type writeFlusher interface {
|
type writeFlusher interface {
|
||||||
|
|
Loading…
Reference in a new issue