From f3bae24c81e7198d9bbedaf79056d9961e59113c Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 9 Jul 2015 15:13:38 -0700 Subject: start disconnecting the parameter parser from the instance pass in the instance variable to start decoupling the meat of the parser from the instance of the middleware --- actionpack/lib/action_dispatch/middleware/params_parser.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_dispatch/middleware/params_parser.rb') diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb index 580fe2964a..e2b3b06fd8 100644 --- a/actionpack/lib/action_dispatch/middleware/params_parser.rb +++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb @@ -27,18 +27,18 @@ module ActionDispatch def call(env) default = env["action_dispatch.request.request_parameters"] - env["action_dispatch.request.request_parameters"] = parse_formatted_parameters(env, default) + env["action_dispatch.request.request_parameters"] = parse_formatted_parameters(env, @parsers, default) @app.call(env) end private - def parse_formatted_parameters(env, default) + def parse_formatted_parameters(env, parsers, default) request = Request.new(env) return default if request.content_length.zero? - strategy = @parsers.fetch(request.content_mime_type) { return default } + strategy = parsers.fetch(request.content_mime_type) { return default } strategy.call(request.raw_post) -- cgit v1.2.3