Commit 9261587d authored by comfyanonymous's avatar comfyanonymous
Browse files

Small refactor.

parent d6d1a899
......@@ -170,9 +170,9 @@ class PromptServer():
subfolder = post.get("subfolder", "")
full_output_folder = os.path.join(upload_dir, os.path.normpath(subfolder))
filepath = os.path.join(full_output_folder, filename)
filepath = os.path.abspath(os.path.join(full_output_folder, filename))
if os.path.commonpath((upload_dir, os.path.abspath(filepath))) != upload_dir:
if os.path.commonpath((upload_dir, filepath)) != upload_dir:
return web.Response(status=400)
if not os.path.exists(full_output_folder):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment