From 7003b36ecfe6f04a87e913828ab0f8dde4e03ecb Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Wed, 9 Jan 2013 15:26:12 -0500 Subject: Fix JSON params parsing regression for non-object JSON content. Backports #8855. --- actionpack/lib/action_dispatch/middleware/params_parser.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb index ac726895fa..0e03d85d9a 100644 --- a/actionpack/lib/action_dispatch/middleware/params_parser.rb +++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb @@ -44,10 +44,10 @@ module ActionDispatch when :yaml YAML.load(request.raw_post) when :json - data = request.deep_munge ActiveSupport::JSON.decode(request.body) + data = ActiveSupport::JSON.decode(request.body) request.body.rewind if request.body.respond_to?(:rewind) data = {:_json => data} unless data.is_a?(Hash) - data.with_indifferent_access + request.deep_munge(data).with_indifferent_access else false end -- cgit v1.2.3