fix(api): image downloads with correct filename

Closes #6730
This commit is contained in:
psychedelicious 2024-08-10 17:54:26 +10:00 committed by Kent Keirsey
parent c3ab8a6aa8
commit 8ecf72838d

View File

@ -253,6 +253,7 @@ async def get_image_full(
content = f.read()
response = Response(content, media_type="image/png")
response.headers["Cache-Control"] = f"max-age={IMAGE_MAX_AGE}"
response.headers["Content-Disposition"] = f'inline; filename="{image_name}"'
return response
except Exception:
raise HTTPException(status_code=404)