mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-03-25 08:55:53 +00:00
HTTP::CookieJar#add: Use the hostname of domain_name.
This commit is contained in:
parent
a47a849387
commit
24e9b26004
1 changed files with 2 additions and 5 deletions
|
|
@ -23,12 +23,9 @@ class HTTP::CookieJar
|
|||
|
||||
# Add a +cookie+ to the jar and return self.
|
||||
def add(cookie)
|
||||
normal_domain = cookie.domain.downcase
|
||||
normal_domain = cookie.domain_name.hostname
|
||||
|
||||
@jar[normal_domain] ||= {} unless @jar.has_key?(normal_domain)
|
||||
|
||||
@jar[normal_domain][cookie.path] ||= {}
|
||||
@jar[normal_domain][cookie.path][cookie.name] = cookie
|
||||
((@jar[normal_domain] ||= {})[cookie.path] ||= {})[cookie.name] = cookie
|
||||
|
||||
self
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue