diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-07 07:55:09 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-07 07:55:19 -0700 |
commit | 9b7ecf0d6d284825a2e1ce57c0074b8f945a791f (patch) | |
tree | 78eac996b19e2098280b246b833d3ba2e3e78935 /actionpack/lib/action_dispatch/http/request.rb | |
parent | 85969c74cdd29776790165b7ef1d833ccacb1585 (diff) | |
download | rails-9b7ecf0d6d284825a2e1ce57c0074b8f945a791f.tar.gz rails-9b7ecf0d6d284825a2e1ce57c0074b8f945a791f.tar.bz2 rails-9b7ecf0d6d284825a2e1ce57c0074b8f945a791f.zip |
refactor param parsing middleware to use request objects
this is another place that we should stop directly accessing the env
hash and let the request object take care of that for us
Diffstat (limited to 'actionpack/lib/action_dispatch/http/request.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 3a26c1904e..d785635d1a 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -339,6 +339,14 @@ module ActionDispatch LOCALHOST =~ remote_addr && LOCALHOST =~ remote_ip end + def request_parameters=(params) + env["action_dispatch.request.request_parameters".freeze] = params + end + + def logger + env["action_dispatch.logger".freeze] + end + private def check_method(name) HTTP_METHOD_LOOKUP[name] || raise(ActionController::UnknownHttpMethod, "#{name}, accepted HTTP methods are #{HTTP_METHODS[0...-1].join(', ')}, and #{HTTP_METHODS[-1]}") |