summaryrefslogtreecommitdiff
path: root/websocket/_handshake.py
diff options
context:
space:
mode:
authorliris <liris.pp@gmail.com>2015-03-24 12:04:54 +0900
committerliris <liris.pp@gmail.com>2015-03-24 12:04:54 +0900
commit77faf8c6f8b719cfe9ba6afc02ce39150c1f20a3 (patch)
tree745406d4458fdb02448a01f4210ceb773b121a3d /websocket/_handshake.py
parentcac1cf234e7f1560556c817f1a828e4e3b53a608 (diff)
downloadwebsocket-client-77faf8c6f8b719cfe9ba6afc02ce39150c1f20a3.tar.gz
fixed #158
Diffstat (limited to 'websocket/_handshake.py')
-rw-r--r--websocket/_handshake.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/websocket/_handshake.py b/websocket/_handshake.py
index 10b6ec9..ddcd4d3 100644
--- a/websocket/_handshake.py
+++ b/websocket/_handshake.py
@@ -117,8 +117,8 @@ def _validate(headers, key, subprotocols):
return False, None
if subprotocols:
- subproto = headers.get("sec-websocket-protocol", None)
- if not subproto or subproto not in subprotocols:
+ subproto = headers.get("sec-websocket-protocol", None).lower()
+ if not subproto or subproto not in [s.lower() for s in subprotocols]:
error("Invalid subprotocol: " + str(subprotocols))
return False, None