summaryrefslogtreecommitdiff
path: root/eventlet/websocket.py
diff options
context:
space:
mode:
authorJakub Stasiak <jakub@stasiak.at>2014-01-18 21:54:42 +0000
committerJakub Stasiak <jakub@stasiak.at>2014-01-18 21:57:18 +0000
commitfe5bebbb09cd765f636ecf5088169930fb965fbb (patch)
tree16196d2b30977fe058854b71c7273de108e2bf78 /eventlet/websocket.py
parent849d45682fba7a2a1f16c39f26ad4f2dab80cffc (diff)
downloadeventlet-fe5bebbb09cd765f636ecf5088169930fb965fbb.tar.gz
websockets: handle HTTP_CONNECTION more flexibly
This fixes GitHub issue #73
Diffstat (limited to 'eventlet/websocket.py')
-rw-r--r--eventlet/websocket.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/eventlet/websocket.py b/eventlet/websocket.py
index d99206e..20342db 100644
--- a/eventlet/websocket.py
+++ b/eventlet/websocket.py
@@ -97,7 +97,10 @@ class WebSocketWSGI(object):
return decorator(handler)
def __call__(self, environ, start_response):
- if not (environ.get('HTTP_CONNECTION') == 'Upgrade' and
+ http_connection_parts = [
+ part.strip()
+ for part in environ.get('HTTP_CONNECTION', '').lower().split(',')]
+ if not ('upgrade' in http_connection_parts and
environ.get('HTTP_UPGRADE').lower() == 'websocket'):
# need to check a few more things here for true compliance
start_response('400 Bad Request', [('Connection', 'close')])