From 4927cbea0021993e1d727f47906695304e6f85c0 Mon Sep 17 00:00:00 2001 From: zzjc1234 <2359047351@qq.com> Date: Wed, 17 Jan 2024 14:28:42 +0800 Subject: [PATCH] fix: fail to upload figure --- canvas_app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/canvas_app.py b/canvas_app.py index 08efd22..dd41d9c 100755 --- a/canvas_app.py +++ b/canvas_app.py @@ -37,13 +37,14 @@ # INFO: Safety check for file def check_file(filename): base_path = "/public/res/" + base_path_win = "\\public\\res\\" fullPath = path.normpath(path.join(base_path, filename)) if ( not "." in filename or not filename.rsplit(".", 1)[1].lower() in ALLOWED_EXTENSION ): return "Illegal" - if not fullPath.startswith(base_path): + if not fullPath.startswith(base_path) and not fullPath.startswith(base_path_win): return "Illegal" else: return filename