diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-12-09 14:29:06 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-12-09 14:39:43 -0500 |
commit | 4eb3ef812ce0610912fe67c4f4b048b38b0c0213 (patch) | |
tree | e6aedfaed4ef3fa1335041f7825f7d206d68a531 /actionpack/test | |
parent | a9d72f6e47d42ce2b9f7ad9f957ef1bd4bb6c800 (diff) | |
download | rails-4eb3ef812ce0610912fe67c4f4b048b38b0c0213.tar.gz rails-4eb3ef812ce0610912fe67c4f4b048b38b0c0213.tar.bz2 rails-4eb3ef812ce0610912fe67c4f4b048b38b0c0213.zip |
Do not raise exception when content_type is a empty string
When content type header is blank we were raising an exception because
`empty?` was being called on nil.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/response_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb index 400af42bac..2df70704a1 100644 --- a/actionpack/test/dispatch/response_test.rb +++ b/actionpack/test/dispatch/response_test.rb @@ -110,6 +110,11 @@ class ResponseTest < ActiveSupport::TestCase assert_equal "application/aaron", @response.content_type end + def test_empty_content_type_returns_nil + @response.headers['Content-Type'] = "" + assert_equal nil, @response.content_type + end + test "simple output" do @response.body = "Hello, World!" |