提交 18d19bf2 编写于 作者: R Rafael Mendonça França

Merge pull request #15349 from tgxworld/remove_duplicated_method_call

Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
......@@ -15,7 +15,6 @@ def parameters
query_parameters.dup
end
params.merge!(path_parameters)
params.with_indifferent_access
end
end
alias :params :parameters
......
......@@ -291,7 +291,7 @@ def session_options=(options)
# Override Rack's GET method to support indifferent access
def GET
@env["action_dispatch.request.query_parameters"] ||= Utils.deep_munge((normalize_encode_params(super) || {}))
@env["action_dispatch.request.query_parameters"] ||= Utils.deep_munge(normalize_encode_params(super || {}))
rescue TypeError => e
raise ActionController::BadRequest.new(:query, e)
end
......@@ -299,7 +299,7 @@ def GET
# Override Rack's POST method to support indifferent access
def POST
@env["action_dispatch.request.request_parameters"] ||= Utils.deep_munge((normalize_encode_params(super) || {}))
@env["action_dispatch.request.request_parameters"] ||= Utils.deep_munge(normalize_encode_params(super || {}))
rescue TypeError => e
raise ActionController::BadRequest.new(:request, e)
end
......
......@@ -130,10 +130,7 @@ def teardown
end
test "ambiguous params returns a bad request" do
with_routing do |set|
set.draw do
post ':action', to: ::UrlEncodedParamsParsingTest::TestController
end
with_test_routing do
post "/parse", "foo[]=bar&foo[4]=bar"
assert_response :bad_request
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册