mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Switch to action_dispatch rack namespace
This commit is contained in:
@@ -109,7 +109,7 @@ module ActionController #:nodoc:
|
||||
end
|
||||
|
||||
def recycle!
|
||||
@env["action_controller.request.request_parameters"] = {}
|
||||
@env["action_dispatch.request.request_parameters"] = {}
|
||||
self.query_parameters = {}
|
||||
self.path_parameters = {}
|
||||
@headers, @request_method, @accepts, @content_type = nil, nil, nil, nil
|
||||
|
||||
@@ -437,13 +437,13 @@ EOM
|
||||
|
||||
# Override Rack's GET method to support indifferent access
|
||||
def GET
|
||||
@env["action_controller.request.query_parameters"] ||= normalize_parameters(super)
|
||||
@env["action_dispatch.request.query_parameters"] ||= normalize_parameters(super)
|
||||
end
|
||||
alias_method :query_parameters, :GET
|
||||
|
||||
# Override Rack's POST method to support indifferent access
|
||||
def POST
|
||||
@env["action_controller.request.request_parameters"] ||= normalize_parameters(super)
|
||||
@env["action_dispatch.request.request_parameters"] ||= normalize_parameters(super)
|
||||
end
|
||||
alias_method :request_parameters, :POST
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ module ActionDispatch
|
||||
|
||||
def call(env)
|
||||
if params = parse_formatted_parameters(env)
|
||||
env["action_controller.request.request_parameters"] = params
|
||||
env["action_dispatch.request.request_parameters"] = params
|
||||
end
|
||||
|
||||
@app.call(env)
|
||||
|
||||
@@ -307,7 +307,7 @@ class RequestTest < ActiveSupport::TestCase
|
||||
test "restrict method hacking" do
|
||||
[:get, :put, :delete].each do |method|
|
||||
request = stub_request 'REQUEST_METHOD' => method.to_s.upcase,
|
||||
'action_controller.request.request_parameters' => { :_method => 'put' }
|
||||
'action_dispatch.request.request_parameters' => { :_method => 'put' }
|
||||
assert_equal method, request.method
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user