Skip to content

Commit

Permalink
Remove #size call on rack input io
Browse files Browse the repository at this point in the history
  • Loading branch information
josh authored and jeremy committed Apr 7, 2010
1 parent 149d13e commit 0863924
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions actionpack/lib/action_dispatch/middleware/params_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,13 @@ def parse_formatted_parameters(env)
when Proc
strategy.call(request.raw_post)
when :xml_simple, :xml_node
request.body.size == 0 ? {} : Hash.from_xml(request.raw_post).with_indifferent_access
(Hash.from_xml(request.raw_post) || {}).with_indifferent_access
when :yaml
YAML.load(request.raw_post)
when :json
if request.body.size == 0
{}
else
data = ActiveSupport::JSON.decode(request.raw_post)
data = {:_json => data} unless data.is_a?(Hash)
data.with_indifferent_access
end
data = ActiveSupport::JSON.decode(request.raw_post)
data = {:_json => data} unless data.is_a?(Hash)
data.with_indifferent_access
else
false
end
Expand Down

0 comments on commit 0863924

Please sign in to comment.