Simply use cookie.domain instead of cookie.domain_name.hostname.

This commit is contained in:
Akinori MUSHA 2013-04-12 01:19:49 +09:00
parent f3b8abdd8e
commit a485e83ad9

View file

@ -55,14 +55,14 @@ class HTTP::CookieJar
end end
def add(cookie) def add(cookie)
path_cookies = ((@jar[cookie.domain_name.hostname] ||= {})[cookie.path] ||= {}) path_cookies = ((@jar[cookie.domain] ||= {})[cookie.path] ||= {})
path_cookies[cookie.name] = cookie path_cookies[cookie.name] = cookie
cleanup if (@gc_index += 1) >= @gc_threshold cleanup if (@gc_index += 1) >= @gc_threshold
self self
end end
def delete(cookie) def delete(cookie)
path_cookies = ((@jar[cookie.domain_name.hostname] ||= {})[cookie.path] ||= {}) path_cookies = ((@jar[cookie.domain] ||= {})[cookie.path] ||= {})
path_cookies.delete(cookie.name) path_cookies.delete(cookie.name)
self self
end end