diff options
author | Dylan Smith <Dylan.Smith@shopify.com> | 2013-01-09 15:26:12 -0500 |
---|---|---|
committer | Dylan Smith <Dylan.Smith@shopify.com> | 2013-01-11 00:14:49 -0500 |
commit | 7003b36ecfe6f04a87e913828ab0f8dde4e03ecb (patch) | |
tree | d100fa9b22d47dcf58212f56c4f98e5226d37005 /actionpack/lib | |
parent | d564ee06a8430df809397a64e2d5f9d797be7106 (diff) | |
download | rails-7003b36ecfe6f04a87e913828ab0f8dde4e03ecb.tar.gz rails-7003b36ecfe6f04a87e913828ab0f8dde4e03ecb.tar.bz2 rails-7003b36ecfe6f04a87e913828ab0f8dde4e03ecb.zip |
Fix JSON params parsing regression for non-object JSON content.
Backports #8855.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/params_parser.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |