fix linter issues

This commit is contained in:
Jakob Ketterl 2021-05-10 23:02:43 +02:00
parent 40c78940ef
commit 301b3b59a5

View File

@ -53,11 +53,11 @@ class WebSocketConnection(object):
self.sendLock = threading.Lock() self.sendLock = threading.Lock()
headers = {key.lower(): value for key, value in self.handler.headers.items()} headers = {key.lower(): value for key, value in self.handler.headers.items()}
if not "upgrade" in headers: if "upgrade" not in headers:
raise WebSocketException("Upgrade header not found") raise WebSocketException("Upgrade header not found")
if headers["upgrade"].lower() != "websocket": if headers["upgrade"].lower() != "websocket":
raise WebSocketException("Upgrade header does not contain expected value") raise WebSocketException("Upgrade header does not contain expected value")
if not "sec-websocket-key" in headers: if "sec-websocket-key" not in headers:
raise WebSocketException("Websocket key not provided") raise WebSocketException("Websocket key not provided")
ws_key = headers["sec-websocket-key"] ws_key = headers["sec-websocket-key"]