diff options
author | Matthew Draper <matthew@trebex.net> | 2016-12-20 21:34:21 +1030 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-20 21:34:21 +1030 |
commit | 695065281e75d05f942d2a5eb6b203da8d672770 (patch) | |
tree | 512fe5d2a38b4e665b7648378f4f0a1e48c7aedb /actionpack/test | |
parent | a65ccb55f234b8f218be83eb5df57f3162cf7c55 (diff) | |
parent | 51a9311b2d31c77a70b2acc7c03fcd561184ff0d (diff) | |
download | rails-695065281e75d05f942d2a5eb6b203da8d672770.tar.gz rails-695065281e75d05f942d2a5eb6b203da8d672770.tar.bz2 rails-695065281e75d05f942d2a5eb6b203da8d672770.zip |
Merge pull request #27408 from matthewd/charset-fix
Only default the response charset when it is first set
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/send_file_test.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb index a28283f4d6..9e6b975fe2 100644 --- a/actionpack/test/controller/send_file_test.rb +++ b/actionpack/test/controller/send_file_test.rb @@ -241,10 +241,17 @@ class SendFileTest < ActionController::TestCase assert_equal "text/calendar; charset=utf-8", response.headers["Content-Type"] end + def test_send_file_charset_with_type_options_key_without_charset + @controller = SendFileWithActionControllerLive.new + @controller.options = { type: "image/png" } + response = process("file") + assert_equal "image/png", response.headers["Content-Type"] + end + def test_send_file_charset_with_content_type_options_key @controller = SendFileWithActionControllerLive.new @controller.options = { content_type: "text/calendar" } response = process("file") - assert_equal "text/calendar; charset=utf-8", response.headers["Content-Type"] + assert_equal "text/calendar", response.headers["Content-Type"] end end |