From 8dbf37a17386be1acd64f417bffb08a420c76cef Mon Sep 17 00:00:00 2001 From: Tasos Sahanidis Date: Wed, 20 Sep 2017 03:57:33 +0300 Subject: [PATCH] Web: Fix exception raised due to lack of Content-Type --- plugins/Web/plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/Web/plugin.py b/plugins/Web/plugin.py index aab7885c5..ebad498c9 100644 --- a/plugins/Web/plugin.py +++ b/plugins/Web/plugin.py @@ -279,6 +279,8 @@ class Web(callbacks.PluginRegexp): try: try: size = fd.headers['Content-Length'] + if size is None: + raise KeyError('content-length') irc.reply(format(_('%u is %S long.'), url, int(size))) except KeyError: size = conf.supybot.protocols.http.peekSize()