diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-09 15:13:38 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-10 11:53:06 -0700 |
commit | f3bae24c81e7198d9bbedaf79056d9961e59113c (patch) | |
tree | df10d96a642f7bcde63018d95206e82c0896ac8b | |
parent | a1d7d65f0a21215851e45639ef7d0df35993ecaa (diff) | |
download | rails-f3bae24c81e7198d9bbedaf79056d9961e59113c.tar.gz rails-f3bae24c81e7198d9bbedaf79056d9961e59113c.tar.bz2 rails-f3bae24c81e7198d9bbedaf79056d9961e59113c.zip |
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
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/params_parser.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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) |