From d409a04b5a9f26d0640158fc61ad0d7d2da3e567 Mon Sep 17 00:00:00 2001 From: Miles Burton Date: Fri, 6 Jan 2017 12:42:31 +0000 Subject: [PATCH] Update rxws.py Some clients send "WebSocket". Use a case insensitive compare. --- rxws.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rxws.py b/rxws.py index c44cfa506..d64d7fdac 100644 --- a/rxws.py +++ b/rxws.py @@ -38,7 +38,7 @@ def handshake(myself): #print h_key_exists("upgrade") #print h_value("upgrade") #print h_key_exists("sec-websocket-key") - if (not h_key_exists("upgrade")) or not (h_value("upgrade")=="websocket") or (not h_key_exists("sec-websocket-key")): + if (not h_key_exists("upgrade")) or not (h_value("upgrade").lower()=="websocket") or (not h_key_exists("sec-websocket-key")): raise WebSocketException ws_key=h_value("sec-websocket-key") ws_key_toreturn=base64.b64encode(sha.new(ws_key+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11").digest())