提交 de6b43bf 编写于 作者: A Aaron Patterson

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
上级 e6074a35
......@@ -8,7 +8,7 @@
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 @@ class CookieJar #:nodoc:
# $& => 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
......
......@@ -19,7 +19,7 @@ def flash
end
def cookies
@cookie_jar ||= Cookies::CookieJar.build(@request, @request.host, @request.ssl?, @request.cookies)
@cookie_jar ||= Cookies::CookieJar.build(@request, @request.cookies)
end
def redirect_to_url
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册