diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/cgi_process.rb | 4 | ||||
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb index ba9235ef81..9166a8d433 100644 --- a/actionpack/lib/action_controller/cgi_process.rb +++ b/actionpack/lib/action_controller/cgi_process.rb @@ -63,8 +63,8 @@ module ActionController #:nodoc: end def request_parameters - if env['HTTP_X_POST_DATA_FORMAT'] - CGIMethods.parse_formatted_request_parameters(env['HTTP_X_POST_DATA_FORMAT'].downcase.intern, env['RAW_POST_DATA']) + if formatted_post? + CGIMethods.parse_formatted_request_parameters(post_format, env['RAW_POST_DATA']) else CGIMethods.parse_request_parameters(@cgi.params) end diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index 02682b57cf..214edf250e 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -3,7 +3,6 @@ module ActionController class AbstractRequest # Returns both GET and POST parameters in a single hash. def parameters - # puts "#{request_parameters.inspect} | #{query_parameters.inspect} | #{path_parameters.inspect}" @parameters ||= request_parameters.merge(query_parameters).merge(path_parameters).with_indifferent_access end @@ -36,7 +35,14 @@ module ActionController if env['HTTP_X_POST_DATA_FORMAT'] env['HTTP_X_POST_DATA_FORMAT'].downcase.intern else - :query_string + case env['HTTP_CONTENT_TYPE'] + when 'application/xml', 'text/xml' + :xml + when 'application/x-yaml', 'text/x-yaml' + :yaml + else + :url_encoded + end end end |