Merge pull request 'Fix file download filename' (#50) from fix/file-download-filename into main
Deploy Dashboard / deploy (push) Failing after 3m44s
Run Tests / Backend Tests (push) Failing after 4m39s
Run Tests / Frontend Tests (push) Failing after 36s
Run Tests / Test Summary (push) Failing after 12s

This commit was merged in pull request #50.
This commit is contained in:
2026-04-17 14:18:05 +08:00
+1 -1
View File
@@ -94,7 +94,7 @@ def download(path: str):
target = _safe_path(path) target = _safe_path(path)
if not target.exists(): if not target.exists():
raise HTTPException(status_code=404, detail="File not found") raise HTTPException(status_code=404, detail="File not found")
return FileResponse(target) return FileResponse(target, filename=target.name)
except ValueError: except ValueError:
raise HTTPException(status_code=403, detail="Access denied") raise HTTPException(status_code=403, detail="Access denied")