From 2fd0106a7f2fe8e768c13a2fc8830a3ac804c99f Mon Sep 17 00:00:00 2001 From: db0 Date: Thu, 7 Nov 2024 22:43:15 +0100 Subject: [PATCH] feat: add limiter for styles --- horde/apis/v2/kobold.py | 2 +- horde/apis/v2/stable.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/horde/apis/v2/kobold.py b/horde/apis/v2/kobold.py index 8ad5b3d6..0fabd71d 100644 --- a/horde/apis/v2/kobold.py +++ b/horde/apis/v2/kobold.py @@ -505,7 +505,7 @@ def get(self): decorators = [ limiter.limit( - limit_value=lim.get_request_90min_limit_per_ip, + limit_value="20/hour", key_func=lim.get_request_path, ), limiter.limit(limit_value=lim.get_request_2sec_limit_per_ip, key_func=lim.get_request_path), diff --git a/horde/apis/v2/stable.py b/horde/apis/v2/stable.py index 3c86d4ec..c2247ec1 100644 --- a/horde/apis/v2/stable.py +++ b/horde/apis/v2/stable.py @@ -1482,7 +1482,7 @@ def get(self, style_id): decorators = [ limiter.limit( - limit_value=lim.get_request_90min_limit_per_ip, + limit_value="20/hour", key_func=lim.get_request_path, ), limiter.limit(limit_value=lim.get_request_2sec_limit_per_ip, key_func=lim.get_request_path),