From 66ff34cf05f5ed1624e8efb39d2b311ffe3ba5f4 Mon Sep 17 00:00:00 2001 From: arijitchakraborty Date: Thu, 18 Jul 2013 20:51:56 +0530 Subject: [PATCH] improving hostname extraction --- scrapy/http/cookies.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scrapy/http/cookies.py b/scrapy/http/cookies.py index 6902d29e8..c137d5ad1 100644 --- a/scrapy/http/cookies.py +++ b/scrapy/http/cookies.py @@ -22,11 +22,7 @@ class CookieJar(object): # the cookiejar implementation iterates through all domains # instead we restrict to potential matches on the domain - req_host = urlparse_cached(request).netloc - - # Strip port numbers from netloc, if present - if ':' in req_host: - req_host = req_host.split(':')[0] + req_host = urlparse_cached(request).hostname if not IPV4_RE.search(req_host): hosts = potential_domain_matches(req_host)