2 Commits

Author SHA1 Message Date
Gan, Jimmy 1ee244ee39 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
2026-04-17 14:17:33 +08:00
jimmy a807ec00af Merge pull request 'Fix file download error handling' (#49) from fix/file-download-error-handling into main
Deploy Dashboard / deploy (push) Failing after 4m34s
Run Tests / Backend Tests (push) Failing after 4m19s
Run Tests / Frontend Tests (push) Failing after 1m18s
Run Tests / Test Summary (push) Failing after 16s
2026-04-13 10:27:50 +08:00
+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")