From: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Wed, 15 Mar 2023 02:08:10 +0000 (-0700) Subject: Replace commas with underscores to handle Chrome issues with commas X-Git-Tag: v1.14.0-beta.rc1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfaede26c4f5d955f8bd4e01aca855b170fe0f24;p=thirdparty%2Fpaperless-ngx.git Replace commas with underscores to handle Chrome issues with commas --- diff --git a/src/documents/views.py b/src/documents/views.py index ca162e06d0..e7b0fdaa5c 100644 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -311,7 +311,11 @@ class DocumentViewSet( # Firefox is not able to handle unicode characters in filename field # RFC 5987 addresses this issue # see https://datatracker.ietf.org/doc/html/rfc5987#section-4.2 - filename_normalized = normalize("NFKD", filename).encode("ascii", "ignore") + # Chromium cannot handle commas in the filename + filename_normalized = normalize("NFKD", filename.replace(",", "_")).encode( + "ascii", + "ignore", + ) filename_encoded = quote(filename) content_disposition = ( f"{disposition}; "