Permalink
Browse files

In tests, content_type can be nil, which would disturb accepts/format

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent e312cc3 commit 06669f8b13b351c251bc24eb2068c5005c9776a8 @dhh dhh committed Feb 15, 2007
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/request.rb
@@ -78,7 +78,7 @@ def content_type
def accepts
@accepts ||=
if @env['HTTP_ACCEPT'].to_s.strip.empty?
- [ content_type, Mime::ALL ]
+ [ content_type, Mime::ALL ].compact # make sure content_type being nil is not included
else
Mime::Type.parse(@env['HTTP_ACCEPT'])
end

0 comments on commit 06669f8

Please sign in to comment.