diff options
author | Joshua Peek <josh@joshpeek.com> | 2010-04-07 13:12:47 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-04-07 11:41:14 -0700 |
commit | 086392492cdf546713122c6ef1601e45fdf2142f (patch) | |
tree | bc663cf8fbb5951eea04ae5cbbf0488bb1c2b667 /actionpack/lib/action_dispatch/middleware | |
parent | 149d13e1f0d157a48c04c8b3944f09ce463e9416 (diff) | |
download | rails-086392492cdf546713122c6ef1601e45fdf2142f.tar.gz rails-086392492cdf546713122c6ef1601e45fdf2142f.tar.bz2 rails-086392492cdf546713122c6ef1601e45fdf2142f.zip |
Remove #size call on rack input io
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/params_parser.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb index 18a3688bb0..c0efdae2a0 100644 --- a/actionpack/lib/action_dispatch/middleware/params_parser.rb +++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb @@ -36,17 +36,13 @@ module ActionDispatch 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 |