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
上级 e312cc32
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册