[urlreducer] add some checks

This commit is contained in:
nemunaire 2015-11-26 20:51:07 +01:00
parent 57c460fc9c
commit 707131023a

View File

@ -91,7 +91,7 @@ def parselisten(msg):
@hook.post()
def parseresponse(msg):
global LAST_URLS
if hasattr(msg, "text") and msg.text:
if hasattr(msg, "text") and isinstance(msg.text, str):
urls = re.findall("([a-zA-Z0-9+.-]+:(?://)?(?:[^ :/]+:[0-9]+)?[^ :]+)", msg.text)
for url in urls:
o = urlparse(web._getNormalizedURL(url), "http")