From 78a5d9f667c586d1506ba699a17555deeb7d128a Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 1 Apr 2021 15:16:27 +0000 Subject: [PATCH] Add filename header (#29914, #32913). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@20891 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../repositories_subversion_controller_test.rb | 1 + test/functional/wiki_controller_test.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index ef19f2678..14f8390cb 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -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 diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 73b1e3658..1fd8a9492 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -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 -- 2.39.5