Move request parameter parsing from CGI to AbstractRequest.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6742 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper
2007-05-15 22:10:03 +00:00
parent 6d3dc90c33
commit f73e1c2ec0
5 changed files with 55 additions and 49 deletions

View File

@@ -62,20 +62,6 @@ module ActionController
parser.result
end
def parse_formatted_request_parameters(mime_type, body)
case strategy = ActionController::Base.param_parsers[mime_type]
when Proc
strategy.call(body)
when :xml_simple, :xml_node
body.blank? ? {} : Hash.from_xml(body).with_indifferent_access
when :yaml
YAML.load(body)
end
rescue Exception => e # YAML, XML or Ruby code block errors
{ "exception" => "#{e.message} (#{e.class})", "backtrace" => e.backtrace,
"body" => body, "format" => mime_type }
end
private
def get_typed_value(value)
case value