]> source.dussan.org Git - redmine.git/commitdiff
Add filename header (#29914, #32913).
authorGo MAEDA <maeda@farend.jp>
Thu, 1 Apr 2021 15:16:27 +0000 (15:16 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 1 Apr 2021 15:16:27 +0000 (15:16 +0000)
Patch by Pavel Rosický.

git-svn-id: http://svn.redmine.org/redmine/trunk@20891 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/repositories_subversion_controller_test.rb
test/functional/wiki_controller_test.rb

index ef19f267803184752e1583dcb8a6bf72e97163a3..14f8390cb547e49ca587ce37d0a1c6c2eba73949 100644 (file)
@@ -330,6 +330,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest
       )
       assert_response :success
       assert_equal 'attachment; filename="helloworld.c"', @response.headers['Content-Disposition']
+      assert_equal "attachment; filename=\"helloworld.c\"; filename*=UTF-8''helloworld.c", @response.headers['Content-Disposition']
     end
 
     def test_directory_entry
index 73b1e3658a5bc75793a3c2de88d1c0290eefa8ad..1fd8a94922b56133ff3634a324a45029d935a7de 100644 (file)
@@ -1039,7 +1039,7 @@ class WikiControllerTest < Redmine::ControllerTest
 
     assert_response :success
     assert_equal 'application/pdf', @response.media_type
-    assert_equal 'attachment; filename="ecookbook.pdf"', @response.headers['Content-Disposition']
+    assert_equal "attachment; filename=\"ecookbook.pdf\"; filename*=UTF-8''ecookbook.pdf", @response.headers['Content-Disposition']
     assert @response.body.starts_with?('%PDF')
   end
 
@@ -1104,7 +1104,7 @@ class WikiControllerTest < Redmine::ControllerTest
     assert_response :success
 
     assert_equal 'application/pdf', @response.media_type
-    assert_equal 'attachment; filename="CookBook_documentation.pdf"',
+    assert_equal "attachment; filename=\"CookBook_documentation.pdf\"; filename*=UTF-8''CookBook_documentation.pdf",
                  @response.headers['Content-Disposition']
   end
 
@@ -1114,7 +1114,7 @@ class WikiControllerTest < Redmine::ControllerTest
     assert_response :success
 
     assert_equal 'text/html', @response.media_type
-    assert_equal 'attachment; filename="CookBook_documentation.html"',
+    assert_equal "attachment; filename=\"CookBook_documentation.html\"; filename*=UTF-8''CookBook_documentation.html",
                  @response.headers['Content-Disposition']
     assert_select 'h1', :text => /CookBook documentation/
   end
@@ -1125,7 +1125,7 @@ class WikiControllerTest < Redmine::ControllerTest
     assert_response :success
 
     assert_equal 'text/html', @response.media_type
-    assert_equal 'attachment; filename="CookBook_documentation.html"',
+    assert_equal "attachment; filename=\"CookBook_documentation.html\"; filename*=UTF-8''CookBook_documentation.html",
                  @response.headers['Content-Disposition']
     assert_select 'h1', :text => /CookBook documentation v2/
   end
@@ -1136,7 +1136,7 @@ class WikiControllerTest < Redmine::ControllerTest
     assert_response :success
 
     assert_equal 'text/plain', @response.media_type
-    assert_equal 'attachment; filename="CookBook_documentation.txt"',
+    assert_equal "attachment; filename=\"CookBook_documentation.txt\"; filename*=UTF-8''CookBook_documentation.txt",
                  @response.headers['Content-Disposition']
     assert_include 'h1. CookBook documentation', @response.body
   end
@@ -1147,7 +1147,7 @@ class WikiControllerTest < Redmine::ControllerTest
     assert_response :success
 
     assert_equal 'text/plain', @response.media_type
-    assert_equal 'attachment; filename="CookBook_documentation.txt"',
+    assert_equal "attachment; filename=\"CookBook_documentation.txt\"; filename*=UTF-8''CookBook_documentation.txt",
                  @response.headers['Content-Disposition']
     assert_include 'h1. CookBook documentation v2', @response.body
   end