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
def add(cookie)
path_cookies = ((@jar[cookie.domain_name.hostname] ||= {})[cookie.path] ||= {})
path_cookies = ((@jar[cookie.domain] ||= {})[cookie.path] ||= {})
path_cookies[cookie.name] = cookie
cleanup if (@gc_index += 1) >= @gc_threshold
self
end
def delete(cookie)
path_cookies = ((@jar[cookie.domain_name.hostname] ||= {})[cookie.path] ||= {})
path_cookies = ((@jar[cookie.domain] ||= {})[cookie.path] ||= {})
path_cookies.delete(cookie.name)
self
end