mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Revert streaming params parser support.
AS Xml and Json parsers expect the request body to be a real IO object supporting methods like getc or ungetc which are not specified by the Rack spec and aren't supported by Passenger or the Rewindable input wrapper. We can restore functionality if the AS parsers are rewritten to support Racks subset of supported IO methods.
This commit is contained in:
parent
a5d06d05fb
commit
5ebfa62427
1 changed files with 3 additions and 3 deletions
|
@ -35,14 +35,14 @@ module ActionDispatch
|
||||||
when Proc
|
when Proc
|
||||||
strategy.call(request.raw_post)
|
strategy.call(request.raw_post)
|
||||||
when :xml_simple, :xml_node
|
when :xml_simple, :xml_node
|
||||||
request.body.size == 0 ? {} : Hash.from_xml(request.body).with_indifferent_access
|
request.body.size == 0 ? {} : Hash.from_xml(request.raw_post).with_indifferent_access
|
||||||
when :yaml
|
when :yaml
|
||||||
YAML.load(request.body)
|
YAML.load(request.raw_post)
|
||||||
when :json
|
when :json
|
||||||
if request.body.size == 0
|
if request.body.size == 0
|
||||||
{}
|
{}
|
||||||
else
|
else
|
||||||
data = ActiveSupport::JSON.decode(request.body)
|
data = ActiveSupport::JSON.decode(request.raw_post)
|
||||||
data = {:_json => data} unless data.is_a?(Hash)
|
data = {:_json => data} unless data.is_a?(Hash)
|
||||||
data.with_indifferent_access
|
data.with_indifferent_access
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue