From 5d23a2e46b408ce3fc76b2e72b48a03b3ad77ec1 Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Mon, 17 Jun 2019 00:52:42 -0400 Subject: [PATCH] check content-length for scrolls --- ASCII/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ASCII/plugin.py b/ASCII/plugin.py index 169af4f..659035d 100644 --- a/ASCII/plugin.py +++ b/ASCII/plugin.py @@ -844,7 +844,7 @@ class ASCII(callbacks.Plugin): ua = UserAgent() header = {'User-Agent':str(ua.random)} r = requests.head(url, headers=header) - if "text/plain" in r.headers["content-type"]: + if "text/plain" in r.headers["content-type"] and int(r.headers["content-length"]) < 1000000: file = requests.get(url, headers=header) else: irc.reply("Invalid file type.", private=False, notice=False)