提交 ba9887c9 编写于 作者: J Joshua Peek

Switch to action_dispatch rack namespace

上级 7b3b7cb2
......@@ -109,7 +109,7 @@ def assign_parameters(controller_path, action, parameters)
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 @@ def form_data?
# 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 @@ def initialize(app)
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 @@ def teardown
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册