]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Re-add fix from #9599
authorshamoon <4887959+shamoon@users.noreply.github.com>
Wed, 9 Apr 2025 22:54:11 +0000 (15:54 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Wed, 9 Apr 2025 22:54:11 +0000 (15:54 -0700)
src/paperless/views.py

index 4527e7465b45f66a5dbfde5c99b7c78b43478fad..57c1ec807fda94bf6611092767b4008829b413cd 100644 (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 = (