Commit 8799d1aa authored by Sam Rushing's avatar Sam Rushing

handler.match(): handle non-websocket probe more cleanly

parent 4bf57b19
......@@ -65,7 +65,12 @@ class handler:
def match (self, request):
# try to catch both versions of the protocol
return request.path == self.path and request.method == 'get' and request['upgrade'].lower() == 'websocket'
return (
request.path == self.path
and request.method == 'get'
and request['upgrade']
and request['upgrade'].lower() == 'websocket'
)
def h76_frob (self, key):
digits = int (''.join ([ x for x in key if x in '0123456789' ]))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment