From b5ef62348e6d12eca60e459d16bb9861678ff7ed Mon Sep 17 00:00:00 2001 From: Benjamin Braatz Date: Wed, 13 Jan 2021 03:24:38 +0100 Subject: [PATCH] Typo sever -> server --- graphit_controlpi/websocket.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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' -- 2.34.1