From 66fdec0eb92bf11c0bc477d6fb1df3dc783e4dcb Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 26 May 2023 17:24:43 +0200 Subject: [mod] limiter: add config file /etc/searxng/limiter.toml Signed-off-by: Markus Heiser --- searx/botdetection/http_accept_language.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'searx/botdetection/http_accept_language.py') 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 -- cgit v1.2.3-54-g00ecf