diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 80829b9946c..5ca5452a4ff 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -781,7 +781,7 @@ def encode_digest(digest): class AbstractHTTPHandler(BaseHandler): def do_open(self, http_class, req): - host = urlparse.urlparse(req.get_full_url())[1] + host = req.get_host() if not host: raise URLError('no host given')