Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-09-23 20:19:45 +0200
committerArthur de Jong <arthur@arthurdejong.org>2010-09-23 20:19:45 +0200
commit64b61d880b8ebc2f0f5d634b1b65c5a332aefda8 (patch)
treeb0d359e3e0e1276cdebe709839fa248a77bc09d5
parentaa5232a8e4c03d257f4acb361efeaa01a542f291 (diff)
handle the case where hostname is empty
git-svn-id: http://arthurdejong.org/svn/webcheck/webcheck@414 86f53f14-5ff3-0310-afe5-9b438ce3f40c
-rw-r--r--schemes/http.py4
1 files changed, 4 insertions, 0 deletions
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')