Fix: Websocket detection case sensitive (#1040)

This commit is contained in:
Pascal Vizeli 2019-04-15 17:03:36 +02:00 committed by GitHub
parent 0da924f10b
commit 3ed7cbe2ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -209,8 +209,8 @@ def _is_websocket(request: web.Request) -> bool:
headers = request.headers
if (
headers.get(hdrs.CONNECTION) == "Upgrade"
and headers.get(hdrs.UPGRADE) == "websocket"
headers.get(hdrs.CONNECTION, "").lower() == "upgrade"
and headers.get(hdrs.UPGRADE, "").lower() == "websocket"
):
return True
return False