Fix file download filename #50

Merged
jimmy merged 1 commits from fix/file-download-filename into main 2026-04-17 14:18:06 +08:00
Showing only changes of commit 1ee244ee39 - Show all commits
+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")