aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2020-04-05 22:41:33 +0100
committerGravatar jesopo2020-04-05 22:41:33 +0100
commit8a3f10e3601d63256f0192d43c389d7e62a3b1b9 (patch)
tree7edd502ba37feffa61ef02cf232aca1b5d88f7ac /modules
parentadd .send_action utils functions to Server, Channel and User (diff)
signature
handle http redirects ourselves, to prevent redirect to localhost
Diffstat (limited to 'modules')
-rw-r--r--modules/title.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/title.py b/modules/title.py
index 526a8131..9735d667 100644
--- a/modules/title.py
+++ b/modules/title.py
@@ -45,13 +45,9 @@ class Module(ModuleManager.BaseModule):
if not urllib.parse.urlparse(url).scheme:
url = "http://%s" % url
- hostname = urllib.parse.urlparse(url).hostname
- if not utils.http.host_permitted(hostname):
- self.log.warn("Attempted to get forbidden host: %s", [url])
- return -1, None
-
+ request = utils.http.Request(url, check_hostname=True)
try:
- page = utils.http.request(url)
+ page = utils.http.request(request)
except Exception as e:
self.log.error("failed to get URL title for %s: %s", [url, str(e)])
return -1, None