fix(personal): resolve upload delete path (#4291)

This commit is contained in:
RaresKeY
2026-06-15 17:38:37 +03:00
committed by GitHub
parent fb0a64fe4f
commit 85a773ea02
2 changed files with 76 additions and 2 deletions
+2 -2
View File
@@ -278,8 +278,8 @@ def setup_personal_routes(personal_docs_manager, rag_manager, rag_available):
# Delete file from disk if it's in uploads dir
deleted_from_disk = False
try:
abs_target = os.path.abspath(filepath)
base_abs = os.path.abspath(UPLOADS_DIR)
abs_target = os.path.realpath(filepath)
base_abs = os.path.realpath(UPLOADS_DIR)
in_uploads = (
abs_target == base_abs
or os.path.commonpath([abs_target, base_abs]) == base_abs