summaryrefslogtreecommitdiff
path: root/searx/botdetection/http_accept_language.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2023-05-26 17:24:43 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2023-06-01 14:38:53 +0200
commit66fdec0eb92bf11c0bc477d6fb1df3dc783e4dcb (patch)
tree2ce8a9ecf1cdae68e4745c24cab01482d07a5447 /searx/botdetection/http_accept_language.py
parent1ec325adccc427fe05cf08da9a2d9d63da7365f4 (diff)
downloadsearxng-66fdec0eb92bf11c0bc477d6fb1df3dc783e4dcb.tar.gz
searxng-66fdec0eb92bf11c0bc477d6fb1df3dc783e4dcb.zip
[mod] limiter: add config file /etc/searxng/limiter.toml
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/botdetection/http_accept_language.py')
-rw-r--r--searx/botdetection/http_accept_language.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/botdetection/http_accept_language.py b/searx/botdetection/http_accept_language.py
index 06743802e..558a216cf 100644
--- a/searx/botdetection/http_accept_language.py
+++ b/searx/botdetection/http_accept_language.py
@@ -11,13 +11,15 @@ if the Accept-Language_ header is unset.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
"""
-
+# pylint: disable=unused-argument
from typing import Optional, Tuple
import flask
+from searx.tools import config
+
-def filter_request(request: flask.Request) -> Optional[Tuple[int, str]]:
+def filter_request(request: flask.Request, cfg: config.Config) -> Optional[Tuple[int, str]]:
if request.headers.get('Accept-Language', '').strip() == '':
return 429, "bot detected, missing HTTP header Accept-Language"
return None