1
0
Fork 0
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:
Joshua Peek 2009-04-30 13:45:12 -05:00
parent 7b3b7cb2ab
commit ba9887c9c0
4 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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