diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-12 05:13:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-12 05:13:55 +0000 |
commit | 9e2932f816b0cac68361bb5adcdad3e4c3caeb04 (patch) | |
tree | 8258ef1eb9c811af61d54c24acb417416afd3878 /actionpack/lib/action_controller/request.rb | |
parent | de660957a50227ef71a7c16524ccec2c45b980b5 (diff) | |
download | rails-9e2932f816b0cac68361bb5adcdad3e4c3caeb04.tar.gz rails-9e2932f816b0cac68361bb5adcdad3e4c3caeb04.tar.bz2 rails-9e2932f816b0cac68361bb5adcdad3e4c3caeb04.zip |
Assume that we accept what we give [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3843 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/request.rb')
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index 16acc50011..300a0ea60c 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -51,7 +51,7 @@ module ActionController return @content_type if @content_type @content_type = @env['CONTENT_TYPE'].to_s.downcase - + if @env['HTTP_X_POST_DATA_FORMAT'] case @env['HTTP_X_POST_DATA_FORMAT'].downcase.to_sym when :yaml @@ -65,8 +65,14 @@ module ActionController end def accepts - @accepts ||= (@env['HTTP_ACCEPT'].strip.blank? ? "*/*" : @env['HTTP_ACCEPT']).split(";").collect! do |mime_type| - Mime::Type.new(mime_type.strip) + return @accepts if @accepts + + @accepts = if @env['HTTP_ACCEPT'].to_s.strip.blank? + [ content_type, Mime::ALL ] + else + @env['HTTP_ACCEPT'].split(";").collect! do |mime_type| + Mime::Type.new(mime_type.strip) + end end end |