diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/mime_type.rb | 2 | ||||
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/mime_type.rb b/actionpack/lib/action_controller/mime_type.rb index 0ab0221007..15dbc70915 100644 --- a/actionpack/lib/action_controller/mime_type.rb +++ b/actionpack/lib/action_controller/mime_type.rb @@ -39,6 +39,6 @@ module Mime JAVASCRIPT = Type.new "text/javascript" XML = Type.new "application/xml" RSS = Type.new "application/rss+xml" - ATOM = Type.new "application/rss+atom" + ATOM = Type.new "application/atom+xml" YAML = Type.new "application/x-yaml" end
\ No newline at end of file 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 |