diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-11-22 02:21:57 -0500 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-11-22 23:06:12 +0100 |
commit | 61950a4b05ce1b5640ac3f3720f9a3368ce95a29 (patch) | |
tree | c87aea1bc0e63f18ea3f695bb18d59c57ddcc65f /actionpack/test/controller | |
parent | c937ddb5cec87168c4eb0d6c3030f771e80c2e72 (diff) | |
download | rails-61950a4b05ce1b5640ac3f3720f9a3368ce95a29.tar.gz rails-61950a4b05ce1b5640ac3f3720f9a3368ce95a29.tar.bz2 rails-61950a4b05ce1b5640ac3f3720f9a3368ce95a29.zip |
current code ignores http header "Accept" if it
has ....,*/* .
It is possible to a device to send
request such that */* appear at the beginning of the
"Accept" header. This patch ensures that "Accept" header
is ignored for such cases too.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/mime_responds_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index b6ce9f7d34..c68b3ab13f 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -216,6 +216,12 @@ class RespondToControllerTest < ActionController::TestCase assert_response 406 end + def test_json_or_yaml_with_leading_star_star + @request.accept = "*/*, application/json" + get :json_xml_or_html + assert_equal 'HTML', @response.body + end + def test_json_or_yaml xhr :get, :json_or_yaml assert_equal 'JSON', @response.body |