summaryrefslogtreecommitdiff
path: root/searx/botdetection
diff options
context:
space:
mode:
authorBrock Vojkovic <brockv@tuta.io>2024-09-01 02:58:45 +0800
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-09-01 08:37:24 +0200
commitb09aa7e36038307703fdc22cc352920a4d6b9366 (patch)
treebbb9e809b61ecd9b357cffe1ce269983ddc08510 /searx/botdetection
parent5e576b22384727e4ddbb2bfe71effe23dd6b98a8 (diff)
downloadsearxng-b09aa7e36038307703fdc22cc352920a4d6b9366.tar.gz
searxng-b09aa7e36038307703fdc22cc352920a4d6b9366.zip
[fix] correct typo in API_WONDOW to API_WINDOW
Diffstat (limited to 'searx/botdetection')
-rw-r--r--searx/botdetection/ip_limit.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/botdetection/ip_limit.py b/searx/botdetection/ip_limit.py
index 757314f0e..6e36b44fc 100644
--- a/searx/botdetection/ip_limit.py
+++ b/searx/botdetection/ip_limit.py
@@ -76,11 +76,11 @@ LONG_MAX = 150
LONG_MAX_SUSPICIOUS = 10
"""Maximum suspicious requests from one IP in the :py:obj:`LONG_WINDOW`"""
-API_WONDOW = 3600
+API_WINDOW = 3600
"""Time (sec) before sliding window for API requests (format != html) expires."""
API_MAX = 4
-"""Maximum requests from one IP in the :py:obj:`API_WONDOW`"""
+"""Maximum requests from one IP in the :py:obj:`API_WINDOW`"""
SUSPICIOUS_IP_WINDOW = 3600 * 24 * 30
"""Time (sec) before sliding window for one suspicious IP expires."""
@@ -103,7 +103,7 @@ def filter_request(
return None
if request.args.get('format', 'html') != 'html':
- c = incr_sliding_window(redis_client, 'ip_limit.API_WONDOW:' + network.compressed, API_WONDOW)
+ c = incr_sliding_window(redis_client, 'ip_limit.API_WINDOW:' + network.compressed, API_WINDOW)
if c > API_MAX:
return too_many_requests(network, "too many request in API_WINDOW")