Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

do not assume that there is no space between

leading */* and comma

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit eb6ccc9953a5e952737174995b5230f0b2c56b1f 1 parent f5fba91
@neerajdotname neerajdotname authored josevalim committed
View
2  actionpack/lib/action_dispatch/http/mime_negotiation.rb
@@ -48,7 +48,7 @@ def formats
@env["action_dispatch.request.formats"] ||=
if parameters[:format]
Array(Mime[parameters[:format]])
- elsif xhr? || (accept && accept !~ /,\s*\*\/\*|\*\/\*,/)
+ elsif xhr? || (accept && accept !~ /,\s*\*\/\*|\*\/\*\s*,/)
accepts
else
[Mime::HTML]
View
4 actionpack/test/controller/mime_responds_test.rb
@@ -254,6 +254,10 @@ def test_json_or_yaml_with_leading_star_star
@request.accept = "*/*, application/json"
get :json_xml_or_html
assert_equal 'HTML', @response.body
+
+ @request.accept = "*/* , application/json"
+ get :json_xml_or_html
+ assert_equal 'HTML', @response.body
end
def test_json_or_yaml
Please sign in to comment.
Something went wrong with that request. Please try again.