Permalink
Browse files

Merge pull request #21396 from rodzyn/code-cleanup

Code cleanup
  • Loading branch information...
guilleiguaran committed Aug 28, 2015
2 parents 2a6071a + fa216dc commit 3cc7b0a239c66af39acc979d9afa9e7c593c1f4b
@@ -1,6 +1,3 @@
require 'active_support/core_ext/hash/keys'
require 'active_support/core_ext/hash/indifferent_access'
module ActionDispatch
module Http
module Parameters
@@ -34,14 +31,6 @@ def path_parameters=(parameters) #:nodoc:
def path_parameters
get_header(PARAMETERS_KEY) || {}
end
private
# Convert nested Hash to HashWithIndifferentAccess.
#
def normalize_encode_params(params)
ActionDispatch::Request::Utils.normalize_encode_params params
end
end
end
end
@@ -332,7 +332,7 @@ def session_options=(options)
# Override Rack's GET method to support indifferent access
def GET
get_header("action_dispatch.request.query_parameters") do |k|
set_header k, normalize_encode_params(super || {})
set_header k, Request::Utils.normalize_encode_params(super || {})
end
rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e
raise ActionController::BadRequest.new(:query, e)
@@ -342,7 +342,7 @@ def GET
# Override Rack's POST method to support indifferent access
def POST
get_header("action_dispatch.request.request_parameters") do
self.request_parameters = normalize_encode_params(super || {})
self.request_parameters = Request::Utils.normalize_encode_params(super || {})
end
rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e
raise ActionController::BadRequest.new(:request, e)

0 comments on commit 3cc7b0a

Please sign in to comment.