mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Switch to action_dispatch rack namespace
This commit is contained in:
parent
7b3b7cb2ab
commit
ba9887c9c0
4 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue