From b79172a1a23ad7627d13c8909bb61765a8c19397 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 8 Feb 2023 18:54:11 +0200 Subject: [PATCH] add 500MB limit in WPD --- files/routes/posts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/routes/posts.py b/files/routes/posts.py index 7ef2189dcb..b45f4ee113 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -523,6 +523,8 @@ def is_repost(): @limiter.limit(POST_RATE_LIMIT, key_func=get_ID) @auth_required def submit_post(v:User, sub=None): + if request.content_length > 500 * 1024 * 1024: + return {"error": "Max file size is 500 MB."}, 413 url = request.values.get("url", "").strip()