This commit is contained in:
Aevann1 2022-01-06 18:46:09 +02:00
parent a297930dc7
commit 6b7e06f461
27 changed files with 87 additions and 157 deletions

View file

@ -135,9 +135,11 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
@app.post("/comment")
@limiter.limit("1/second")
@limiter.limit("6/minute")
@is_not_banned
@auth_required
@validate_formkey
def api_comment(v):
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
if v and v.patron:
if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413
elif request.content_length > 4 * 1024 * 1024: return {"error":"Max file size is 4 MB."}, 413