fix: set filename in file download response
Run Tests / Backend Tests (pull_request) Failing after 5m23s
Run Tests / Frontend Tests (pull_request) Failing after 34s
Run Tests / Test Summary (pull_request) Failing after 15s

This commit is contained in:
Gan, Jimmy
2026-04-17 14:17:33 +08:00
parent a807ec00af
commit 1ee244ee39
+1 -1
View File
@@ -94,7 +94,7 @@ def download(path: str):
target = _safe_path(path)
if not target.exists():
raise HTTPException(status_code=404, detail="File not found")
return FileResponse(target)
return FileResponse(target, filename=target.name)
except ValueError:
raise HTTPException(status_code=403, detail="Access denied")