diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-04 17:36:15 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-04 17:37:22 -0700 |
commit | 529136d670c46bd66b56c519d4f51ed8f86c75b1 (patch) | |
tree | 2888e7d0f8fb8a58184dd520816def1ba08e9e13 /actionpack/lib/action_dispatch/middleware | |
parent | 3f24fa338ffb63e3f25d1c72f0dc65665fd97cec (diff) | |
download | rails-529136d670c46bd66b56c519d4f51ed8f86c75b1.tar.gz rails-529136d670c46bd66b56c519d4f51ed8f86c75b1.tar.bz2 rails-529136d670c46bd66b56c519d4f51ed8f86c75b1.zip |
stop inheriting from Rack::Request
Just include the modules necessary in the Request object to implement
the things we need. This should make it easier to build delegate
request objects because the API is smaller
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
3 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index f958a88e4b..f37439e4d7 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -4,9 +4,9 @@ require 'active_support/message_verifier' require 'active_support/json' module ActionDispatch - class Request < Rack::Request + class Request def cookie_jar - get_header('action_dispatch.cookies'.freeze) do + fetch_header('action_dispatch.cookies'.freeze) do self.cookie_jar = Cookies::CookieJar.build(self, cookies) end end diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb index 6041f84834..c482b1c5e7 100644 --- a/actionpack/lib/action_dispatch/middleware/flash.rb +++ b/actionpack/lib/action_dispatch/middleware/flash.rb @@ -1,7 +1,7 @@ require 'active_support/core_ext/hash/keys' module ActionDispatch - class Request < Rack::Request + class Request # Access the contents of the flash. Use <tt>flash["notice"]</tt> to # read a notice you put there or <tt>flash["notice"] = "hello"</tt> # to put a new one. diff --git a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb index e225f356df..cd32adabdf 100644 --- a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb @@ -95,7 +95,7 @@ module ActionDispatch end def unpacked_cookie_data(req) - req.get_header("action_dispatch.request.unsigned_session_cookie") do |k| + req.fetch_header("action_dispatch.request.unsigned_session_cookie") do |k| v = stale_session_check! do if data = get_cookie(req) data.stringify_keys! |