Skip to content

Commit

Permalink
Add timeout to web title command
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
  • Loading branch information
kyrias committed Dec 8, 2016
1 parent 9fe4abe commit 07f98d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/Web/plugin.py
Expand Up @@ -147,7 +147,9 @@ def noIgnore(self, irc, msg):

def getTitle(self, irc, url, raiseErrors):
size = conf.supybot.protocols.http.peekSize()
(target, text) = utils.web.getUrlTargetAndContent(url, size=size)
timeout = self.registryValue('timeout')
(target, text) = utils.web.getUrlTargetAndContent(url, size=size,
timeout=timeout)
try:
text = text.decode(utils.web.getEncoding(text) or 'utf8',
'replace')
Expand Down

0 comments on commit 07f98d3

Please sign in to comment.