From 64b61d880b8ebc2f0f5d634b1b65c5a332aefda8 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Thu, 23 Sep 2010 18:19:45 +0000 Subject: handle the case where hostname is empty git-svn-id: http://arthurdejong.org/svn/webcheck/webcheck@414 86f53f14-5ff3-0310-afe5-9b438ce3f40c --- schemes/http.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schemes/http.py b/schemes/http.py index 8b3977f..b5ad6c1 100644 --- a/schemes/http.py +++ b/schemes/http.py @@ -55,6 +55,10 @@ def fetch(link, acceptedtypes): proxyuserpass = None scheme = link.scheme # check validity of netloc (to work around bug in idna module) + if not netloc: + debugio.debug('schemes.http.fetch(): empty hostname') + link.add_linkproblem('empty hostname') + return None if netloc[0] == '.': debugio.debug('schemes.http.fetch(): fail on hostname starting with dot') link.add_linkproblem('hostname starts with a dot') -- cgit v1.2.3