forked from rDrama/rDrama
master
parent
e09f3fd7ad
commit
63754ceb31
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue