From f0c326f6865249432fe26fad3ec5584a2818a4d1 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Thu, 6 Apr 2017 02:29:42 +0000 Subject: [PATCH] Fixed the rate limit a bit --- titanembeds/blueprints/api/api.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/titanembeds/blueprints/api/api.py b/titanembeds/blueprints/api/api.py index b46cbc9..7b04326 100644 --- a/titanembeds/blueprints/api/api.py +++ b/titanembeds/blueprints/api/api.py @@ -159,8 +159,7 @@ def get_online_embed_users(guild_id): @api.route("/fetch", methods=["GET"]) @valid_session_required(api=True) -@rate_limiter.limit("2500/hour") -@rate_limiter.limit("12/minute", key_func = channel_ratelimit_key) +@rate_limiter.limit("1 per 5 second", key_func = channel_ratelimit_key) def fetch(): guild_id = request.args.get("guild_id") channel_id = request.args.get('channel_id') @@ -182,8 +181,7 @@ def fetch(): @api.route("/post", methods=["POST"]) @valid_session_required(api=True) -@rate_limiter.limit("1200/hour") -@rate_limiter.limit("6/minute", key_func = channel_ratelimit_key) +@rate_limiter.limit("1 per 10 second", key_func = channel_ratelimit_key) def post(): guild_id = request.form.get("guild_id") channel_id = request.form.get('channel_id') @@ -205,7 +203,7 @@ def post(): return response @api.route("/create_unauthenticated_user", methods=["POST"]) -@rate_limiter.limit("4/hour", key_func=guild_ratelimit_key) +@rate_limiter.limit("1 per 15 minute", key_func=guild_ratelimit_key) def create_unauthenticated_user(): session['unauthenticated'] = True username = request.form['username']