master
Aevann1 2021-09-10 06:49:36 +02:00
parent e09f3fd7ad
commit 63754ceb31
1 changed files with 8 additions and 2 deletions

View File

@ -277,7 +277,10 @@ def api_comment(v):
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
file=request.files["file"]
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
if request.content_length > 16 * 1024 * 1024:
g.db.rollback()
abort(413)
if 'pcmemes.net' in request.host: url = upload_ibb(file=file)
else: url = upload_imgur(file=file)
@ -692,7 +695,10 @@ def edit_comment(cid, v):
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
file=request.files["file"]
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
if request.content_length > 16 * 1024 * 1024:
g.db.rollback()
abort(413)
if 'pcmemes.net' in request.host: url = upload_ibb(file=file)
else: url = upload_imgur(file=file)