[urlreducer] add some checks
This commit is contained in:
parent
57c460fc9c
commit
707131023a
@ -91,7 +91,7 @@ def parselisten(msg):
|
|||||||
@hook.post()
|
@hook.post()
|
||||||
def parseresponse(msg):
|
def parseresponse(msg):
|
||||||
global LAST_URLS
|
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)
|
urls = re.findall("([a-zA-Z0-9+.-]+:(?://)?(?:[^ :/]+:[0-9]+)?[^ :]+)", msg.text)
|
||||||
for url in urls:
|
for url in urls:
|
||||||
o = urlparse(web._getNormalizedURL(url), "http")
|
o = urlparse(web._getNormalizedURL(url), "http")
|
||||||
|
Loading…
Reference in New Issue
Block a user