SpiffyTitles: RegEx Check For Proxy URL

This commit is contained in:
Gordon Shumway 2021-08-20 16:57:20 -04:00 committed by GitHub
parent 52d087873c
commit cabe4888e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,8 @@ class SpiffyTitles(callbacks.Plugin):
self.proxies["https"] = None
proxy = str(conf.supybot.protocols.http.proxy)
if proxy:
if "http" not in proxy:
match = re.match(r"https?:\/\/", proxy, re.IGNORECASE)
if not match:
proxy = "http://{0}".format(proxy)
self.proxies["http"] = proxy
self.proxies["https"] = proxy