diff options
author | maximerety <maxime.rety@gmail.com> | 2013-03-04 16:41:07 +0100 |
---|---|---|
committer | maximerety <maxime.rety@gmail.com> | 2013-03-05 12:53:10 +0100 |
commit | d0f22a99f9f24d07990e02da55ed937c98d41e03 (patch) | |
tree | 16b27e530bb780805ff0ba69ae3621a0c1d8b534 /actionpack/lib/action_dispatch | |
parent | 927e649bc9dc5740285e4b4e9899421c2bbfefbe (diff) | |
download | rails-d0f22a99f9f24d07990e02da55ed937c98d41e03.tar.gz rails-d0f22a99f9f24d07990e02da55ed937c98d41e03.tar.bz2 rails-d0f22a99f9f24d07990e02da55ed937c98d41e03.zip |
Backport fixes about #7774 to 3-2-stable
Fix ActionDispatch::Request#formats when HTTP_ACCEPT header is an empty
string.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_negotiation.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_negotiation.rb b/actionpack/lib/action_dispatch/http/mime_negotiation.rb index 5c48a60469..42f14bc1e9 100644 --- a/actionpack/lib/action_dispatch/http/mime_negotiation.rb +++ b/actionpack/lib/action_dispatch/http/mime_negotiation.rb @@ -98,8 +98,8 @@ module ActionDispatch BROWSER_LIKE_ACCEPTS = /,\s*\*\/\*|\*\/\*\s*,/ def valid_accept_header - (xhr? && (accept || content_mime_type)) || - (accept && accept !~ BROWSER_LIKE_ACCEPTS) + (xhr? && (accept.present? || content_mime_type)) || + (accept.present? && accept !~ BROWSER_LIKE_ACCEPTS) end def use_accept_header |