aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-09-18 13:05:01 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-09-18 13:05:01 -0700
commit8db2e67c0ab5560314a8e26d93e5fa1eeda5a1fa (patch)
treec5a4834e95835cbf15a0a84f66fe8a84366e4a57 /actionpack
parenta1ced8b52ce60d0634e65aa36cb89f015f9f543d (diff)
downloadrails-8db2e67c0ab5560314a8e26d93e5fa1eeda5a1fa.tar.gz
rails-8db2e67c0ab5560314a8e26d93e5fa1eeda5a1fa.tar.bz2
rails-8db2e67c0ab5560314a8e26d93e5fa1eeda5a1fa.zip
remove the request parameter from `parse_formatted_parameters`
This is an instance method on the request object now so we don't need it anymore
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/http/parameters.rb10
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb2
2 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/http/parameters.rb b/actionpack/lib/action_dispatch/http/parameters.rb
index 3867e514a2..27fadb708e 100644
--- a/actionpack/lib/action_dispatch/http/parameters.rb
+++ b/actionpack/lib/action_dispatch/http/parameters.rb
@@ -48,16 +48,16 @@ module ActionDispatch
private
- def parse_formatted_parameters(request, parsers)
- return yield if request.content_length.zero?
+ def parse_formatted_parameters(parsers)
+ return yield if content_length.zero?
- strategy = parsers.fetch(request.content_mime_type) { return yield }
+ strategy = parsers.fetch(content_mime_type) { return yield }
begin
- strategy.call(request.raw_post)
+ strategy.call(raw_post)
rescue => e # JSON or Ruby code block errors
my_logger = logger || ActiveSupport::Logger.new($stderr)
- my_logger.debug "Error occurred while parsing request parameters.\nContents:\n\n#{request.raw_post}"
+ my_logger.debug "Error occurred while parsing request parameters.\nContents:\n\n#{raw_post}"
raise ParamsParser::ParseError.new(e.message, e)
end
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index cb59510613..eaa7e88b34 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -348,7 +348,7 @@ module ActionDispatch
# Override Rack's POST method to support indifferent access
def POST
fetch_header("action_dispatch.request.request_parameters") do
- pr = parse_formatted_parameters(self, params_parsers) do |params|
+ pr = parse_formatted_parameters(params_parsers) do |params|
super || {}
end
self.request_parameters = Request::Utils.normalize_encode_params(pr)