fd
This commit is contained in:
parent
c51d9bb0a7
commit
57c972f2d2
1 changed files with 8 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue