To recreate: - have a file with a comma in its name - enable the upload plugin on the 856$u in a framework - edit a record in that framework, upload your file in the 856$u - go to your record in the OPAC, click the link for the 856$u - get the error "This page isn't [catalog name] sent an invalid response. ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION" This error is inconsistent. It might be simply that it works in Firefox but not in Chrome.
Working OK for me on master, tested with Firefox and Chromium (87).
Ah yes I know this problem from working on DSpace. I think that it's a Chrome-only bug.
This is actually just a problem for PDF downloads.
Created attachment 119494 [details] [review] Bug 28123: Quote filename value in Content-Disposition header Chrome throws a ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION error if a Content-Disposition header includes an unquoted filename that contains commas. This patch adds quotes around the filename in the Content-Disposition header, which fixes the problem. Test plan: 0. Do not apply the patch yet 1. Obtain a PDF and rename it to include a comma in its name 2. Enable the upload.pl plugin in the 856$u of the Default framework 3. Add/edit a record in the Default Framework and upload a file using the 856$u upload plugin. 4. Click on the resulting file URL in the saved file 5. Note the error ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION is returned instead of the file 6. Apply the patch and restart your Plack instance 7. Click on the resulting file URL in the saved file 8. Note that you now get the PDF file instead of the error
Created attachment 119495 [details] [review] Bug 28123: Fix expected value in unit test
Created attachment 119610 [details] [review] Bug 28123: Quote filename value in Content-Disposition header Chrome throws a ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION error if a Content-Disposition header includes an unquoted filename that contains commas. This patch adds quotes around the filename in the Content-Disposition header, which fixes the problem. Test plan: 0. Do not apply the patch yet 1. Obtain a PDF and rename it to include a comma in its name 2. Enable the upload.pl plugin in the 856$u of the Default framework 3. Add/edit a record in the Default Framework and upload a file using the 856$u upload plugin. 4. Click on the resulting file URL in the saved file 5. Note the error ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION is returned instead of the file 6. Apply the patch and restart your Plack instance 7. Click on the resulting file URL in the saved file 8. Note that you now get the PDF file instead of the error Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 119611 [details] [review] Bug 28123: Fix expected value in unit test Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 119684 [details] [review] Bug 28123: Quote filename value in Content-Disposition header Chrome throws a ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION error if a Content-Disposition header includes an unquoted filename that contains commas. This patch adds quotes around the filename in the Content-Disposition header, which fixes the problem. Test plan: 0. Do not apply the patch yet 1. Obtain a PDF and rename it to include a comma in its name 2. Enable the upload.pl plugin in the 856$u of the Default framework 3. Add/edit a record in the Default Framework and upload a file using the 856$u upload plugin. 4. Click on the resulting file URL in the saved file 5. Note the error ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION is returned instead of the file 6. Apply the patch and restart your Plack instance 7. Click on the resulting file URL in the saved file 8. Note that you now get the PDF file instead of the error Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 119685 [details] [review] Bug 28123: Fix expected value in unit test Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.05
Pushed to 20.05.x for 20.05.11
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.