This commit is contained in:
Aevann1 2021-07-31 11:00:56 +02:00
parent a0ca03fc0c
commit e5370d4017
3 changed files with 6 additions and 7 deletions

View file

@ -312,7 +312,7 @@ def api_comment(v):
)
g.db.add(c)
g.db.flush()
if request.files.get("file"):
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
file=request.files["file"]
if not file.content_type.startswith('image/'):
return jsonify({"error": "That wasn't an image!"}), 400
@ -660,7 +660,7 @@ def edit_comment(cid, v):
g.db.commit()
return {"error": "Too much spam!"}, 403
if request.files.get("file"):
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