diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_negotiation.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/params_wrapper_test.rb | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_negotiation.rb b/actionpack/lib/action_dispatch/http/mime_negotiation.rb index d0c9413efa..e5f20003a3 100644 --- a/actionpack/lib/action_dispatch/http/mime_negotiation.rb +++ b/actionpack/lib/action_dispatch/http/mime_negotiation.rb @@ -29,8 +29,8 @@ module ActionDispatch content_mime_type && content_mime_type.to_s end - def has_content_type? - has_header? "CONTENT_TYPE" + def has_content_type? # :nodoc: + get_header "CONTENT_TYPE" end # Returns the accepted MIME type for the request. diff --git a/actionpack/test/controller/params_wrapper_test.rb b/actionpack/test/controller/params_wrapper_test.rb index 1549405fe7..e0dffc4be4 100644 --- a/actionpack/test/controller/params_wrapper_test.rb +++ b/actionpack/test/controller/params_wrapper_test.rb @@ -212,6 +212,16 @@ class ParamsWrapperTest < ActionController::TestCase ) end end + + def test_handles_empty_content_type + with_default_wrapper_options do + @request.env["CONTENT_TYPE"] = '' + _controller_class.dispatch(:parse, @request, @response) + + assert_equal 200, @response.status + assert_equal '', @response.body + end + end end class NamespacedParamsWrapperTest < ActionController::TestCase |