From 06669f8b13b351c251bc24eb2068c5005c9776a8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 15 Feb 2007 18:52:08 +0000 Subject: [PATCH] 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 --- actionpack/lib/action_controller/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index b1c8692ce1..9f75b32f06 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/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 -- GitLab