提交 08639249 编写于 作者: J Joshua Peek 提交者: Jeremy Kemper

Remove #size call on rack input io

上级 149d13e1
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册