From fc737583fd3c3918c186b883939deac945d3abe8 Mon Sep 17 00:00:00 2001 From: Mac Ryan Date: Fri, 26 Sep 2025 14:44:24 +0200 Subject: [PATCH] Fix fro symlink failures Issue outlined in https://github.com/yeicor-3d/yet-another-cad-viewer/issues/258 --- yacv_server/myhttp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yacv_server/myhttp.py b/yacv_server/myhttp.py index 503320b..9cb9f10 100644 --- a/yacv_server/myhttp.py +++ b/yacv_server/myhttp.py @@ -42,8 +42,8 @@ class HTTPHandler(SimpleHTTPRequestHandler): path = super().translate_path(path) path = os.path.realpath(path) # Avoid symlink hacks if self.directory: # Ensure proper subdirectory - base = os.path.abspath(self.directory) - if not os.path.abspath(path).startswith(base): + base = os.path.realpath(self.directory) + if not path.startswith(base): self.send_error(HTTPStatus.FORBIDDEN, "Path is not in the frontend directory") return '' return path