fix: use _content_disposition_value() for RFC 5987 filename encoding in /api/media

This commit is contained in:
Hermes Agent
2026-04-14 19:35:53 +00:00
parent 5507dae3d7
commit bfb9bbb0bf

View File

@@ -1575,12 +1575,12 @@ def _handle_media(handler, parsed):
if mime in _DOWNLOAD_TYPES or mime not in _INLINE_IMAGE_TYPES:
handler.send_header(
"Content-Disposition",
f'attachment; filename="{target.name}"',
_content_disposition_value("attachment", target.name),
)
else:
handler.send_header(
"Content-Disposition",
f'inline; filename="{target.name}"',
_content_disposition_value("inline", target.name),
)
handler.end_headers()