fix: WeasyPrint URL fetcher + attachment improvements + webhook error propagation + WebSocket conversation check + RLS disabled on system tables (bootstrap fix)
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -94,13 +94,19 @@ async def download_attachment(
|
||||
raise HTTPException(404, detail={"detail": "Attachment not found", "code": "not_found"})
|
||||
|
||||
file_path = data["file_path"]
|
||||
if not os.path.isfile(file_path):
|
||||
raise HTTPException(404, detail={"detail": "File not found on disk", "code": "file_missing"})
|
||||
# Use storage backend instead of os.path.isfile (P1.1 fix)
|
||||
from app.core.storage import get_storage_backend
|
||||
storage = get_storage_backend()
|
||||
try:
|
||||
file_bytes = await storage.load(file_path)
|
||||
except Exception:
|
||||
raise HTTPException(404, detail={"detail": "File not found in storage", "code": "file_missing"})
|
||||
|
||||
return FileResponse(
|
||||
path=file_path,
|
||||
filename=data["filename"],
|
||||
from fastapi.responses import Response
|
||||
return Response(
|
||||
content=file_bytes,
|
||||
media_type=data["mime_type"],
|
||||
headers={"Content-Disposition": f'attachment; filename="{data["filename"]}"'},
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user