From: Benjamin Braatz Date: Wed, 13 Jan 2021 02:24:38 +0000 (+0100) Subject: Typo sever -> server X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=b5ef62348e6d12eca60e459d16bb9861678ff7ed;p=graphit%2Fschaltschrank.git Typo sever -> server --- diff --git a/graphit_controlpi/websocket.py b/graphit_controlpi/websocket.py index a23ac1e..dec240b 100644 --- a/graphit_controlpi/websocket.py +++ b/graphit_controlpi/websocket.py @@ -52,7 +52,7 @@ async def handler(pins, out_queue, websocket, path): task.cancel() -async def process_request(sever_root, path, request_headers): +async def process_request(server_root, path, request_headers): if 'Upgrade' in request_headers: return if path == '/': @@ -62,8 +62,8 @@ async def process_request(sever_root, path, request_headers): ('Connection', 'close'), ] server_root = os.path.realpath(os.path.join(os.getcwd(), server_root)) - full_path = os.path.realpath(os.path.join(sever_root, path[1:])) - if os.path.commonpath((sever_root, full_path)) != sever_root or \ + full_path = os.path.realpath(os.path.join(server_root, path[1:])) + if os.path.commonpath((server_root, full_path)) != server_root or \ not os.path.exists(full_path) or not os.path.isfile(full_path): return HTTPStatus.NOT_FOUND, [], b'404 NOT FOUND' mime_type = 'application/octet-stream'