Merge pull request #1408 from jimpick/fix/websocket-upgrade-case

Make websocket connection upgrade header check case-insensitive
This commit is contained in:
Łukasz Magiera 2020-03-13 22:28:33 +01:00 committed by GitHub
commit f4bf6ee186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,8 @@ func (s *RPCServer) handleWS(ctx context.Context, w http.ResponseWriter, r *http
func (s *RPCServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
if strings.Contains(r.Header.Get("Connection"), "Upgrade") {
h := strings.ToLower(r.Header.Get("Connection"))
if strings.Contains(h, "upgrade") {
s.handleWS(ctx, w, r)
return
}