diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2023-05-26 17:24:43 +0200 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarit.de> | 2023-06-01 14:38:53 +0200 |
| commit | 66fdec0eb92bf11c0bc477d6fb1df3dc783e4dcb (patch) | |
| tree | 2ce8a9ecf1cdae68e4745c24cab01482d07a5447 /searx/botdetection/http_accept.py | |
| parent | 1ec325adccc427fe05cf08da9a2d9d63da7365f4 (diff) | |
[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.py')
| -rw-r--r-- | searx/botdetection/http_accept.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/botdetection/http_accept.py b/searx/botdetection/http_accept.py index 1ab7cb4c1..23670a283 100644 --- a/searx/botdetection/http_accept.py +++ b/searx/botdetection/http_accept.py @@ -13,12 +13,15 @@ Accept_ header .. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept """ +# 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 'text/html' not in request.accept_mimetypes: return 429, "bot detected, HTTP header Accept did not contain text/html" return None |