Project

General

Profile

Actions

Defect #32914

closed

Rails 6: remove #filename_for_content_disposition for MS browsers

Added by Pavel Rosický over 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails support
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

relates to #32913

this prevents double escaping, fixes

WikiControllerTest#test_show_filename_should_be_uri_encoded_for_ms_browsers [/redmine/test/functional/wiki_controller_test.rb:1146]:
--- expected
+++ actual
@@ -1 +1 @@
-"attachment; filename=\"Этика_менеджмента.pdf\"" 
+"attachment; filename=\"%3F%3F%3F%3F%3F_%3F%3F%3F%3F%3F%3F%3F%3F%3F%3F%3F.pdf\"; filename*=UTF-8''%D0%AD%D1%82%D0%B8%D0%BA%D0%B0_%D0%BC%D0%B5%D0%BD%D0%B5%D0%B4%D0%B6%D0%BC%D0%B5%D0%BD%D1%82%D0%B0.pdf" 

Rails 6 escapes filenames per RFC 2231 for all browsers https://github.com/rails/rails/commit/890485cfce4c361c03a41ec23b0ba187007818cc

#filename_for_content_disposition just returns the original name for compatibility reasons, but if we don't care, we can just remove the method


Files

msescape.patch (2.35 KB) msescape.patch Pavel Rosický, 2020-01-29 02:00

Related issues

Related to Redmine - Feature #29914: Migrate to Rails 6.1 with Zeitwerk autoloadingClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF