check content-length for scrolls

This commit is contained in:
Gordon Shumway 2019-06-17 00:52:42 -04:00 committed by GitHub
parent 620ed0b44d
commit 5d23a2e46b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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)