Skip to content

Commit d65cd3a

Browse files
committed
upgrade.protocol might not be set
1 parent e3ebfcf commit d65cd3a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
build
12
*.egg-info

ws4py/server/wsgi/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __init__(self, handle, fallback_app=None, protocols=None, extensions=None,
6464
def __call__(self, environ, start_response):
6565
# Initial handshake validation
6666
try:
67-
if 'websocket' not in environ.get('upgrade.protocol'):
67+
if 'websocket' not in environ.get('upgrade.protocol', ''):
6868
raise HandshakeError("Upgrade protocol is not websocket")
6969

7070
if environ.get('REQUEST_METHOD') != 'GET':

0 commit comments

Comments
 (0)