Serving bug fixes
authorBenjamin Braatz <bb@bbraatz.eu>
Wed, 13 Jan 2021 02:20:04 +0000 (03:20 +0100)
committerBenjamin Braatz <bb@bbraatz.eu>
Wed, 13 Jan 2021 02:20:04 +0000 (03:20 +0100)
graphit_controlpi/websocket.py
setup.py

index 9d0ee8e60d3b8214ea86aaf270dc64bb18c11ef2..a23ac1e72c809605f6faa86aa5f3385ff54ea7f9 100644 (file)
@@ -1,3 +1,4 @@
+import os
 import functools
 import socket
 import json
@@ -60,6 +61,7 @@ async def process_request(sever_root, path, request_headers):
         ('Server', 'graphit_controlpi websocket server'),
         ('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 \
             not os.path.exists(full_path) or not os.path.isfile(full_path):
index 6f4a32865bd5777ce456371278bb44884cb96c93..b848e3a1d5160eeab1176aca61f2922ac7288c1c 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ with open("README.md", "r") as readme_file:
 
 setuptools.setup(
     name="graphit-controlpi",
-    version="0.2.1",
+    version="0.2.2",
     author="Graph-IT GmbH",
     author_email="info@graph-it.com",
     description="Main Module for Machine Control Pi",