Re-add fix from #9599

This commit is contained in:
shamoon 2025-04-09 15:54:11 -07:00
parent 8cfa9061d4
commit e628c488cf
No known key found for this signature in database

View File

@ -2774,9 +2774,13 @@ def serve_file(*, doc: Document, use_archive: bool, disposition: str):
# RFC 5987 addresses this issue
# see https://datatracker.ietf.org/doc/html/rfc5987#section-4.2
# Chromium cannot handle commas in the filename
filename_normalized = normalize("NFKD", filename.replace(",", "_")).encode(
"ascii",
"ignore",
filename_normalized = (
normalize("NFKD", filename.replace(",", "_"))
.encode(
"ascii",
"ignore",
)
.decode("ascii")
)
filename_encoded = quote(filename)
content_disposition = (