diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-05 17:59:28 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-05 17:59:28 -0700 |
commit | de6b43bfd142c6d96548a0bdf53b8f0bc5702343 (patch) | |
tree | ef29799a760f52ff728dd14635bc76edead56ca7 /actionpack/lib/action_dispatch/middleware | |
parent | e6074a35412b85c4c27a7d8063c68370617e3daa (diff) | |
download | rails-de6b43bfd142c6d96548a0bdf53b8f0bc5702343.tar.gz rails-de6b43bfd142c6d96548a0bdf53b8f0bc5702343.tar.bz2 rails-de6b43bfd142c6d96548a0bdf53b8f0bc5702343.zip |
sop passing host and secure to the build method
eventually we will make the cookie jar derive these values from the
request object rather than save a reference to the values
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/cookies.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index b654078b66..a9c7419aae 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -8,7 +8,7 @@ require 'active_support/json' module ActionDispatch class Request < Rack::Request def cookie_jar - env['action_dispatch.cookies'] ||= Cookies::CookieJar.build(self, host, ssl?, cookies) + env['action_dispatch.cookies'] ||= Cookies::CookieJar.build(self, cookies) end def key_generator @@ -254,8 +254,10 @@ module ActionDispatch # $& => example.local DOMAIN_REGEXP = /[^.]*\.([^.]*|..\...|...\...)$/ - def self.build(req, host, secure, cookies) + def self.build(req, cookies) key_generator = req.key_generator + host = req.host + secure = req.ssl? new(key_generator, host, secure, req).tap do |hash| hash.update(cookies) end |