diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2023-04-03 19:36:28 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2023-04-03 19:36:28 +0200 |
commit | 03f94962b63eb8e189b0b4983c0329d0c29c34ab (patch) | |
tree | d3b74645603aff7a77c92b86e9a9444fd6c698a8 /searx/plugins | |
parent | 464e69665cef7fb0b4bbd1c08578fcdd0ecfd48c (diff) | |
download | searxng-03f94962b63eb8e189b0b4983c0329d0c29c34ab.tar.gz searxng-03f94962b63eb8e189b0b4983c0329d0c29c34ab.zip |
[fix] limiter: never block a /healthz request
Related: https://github.com/searxng/searxng/issues/2310#issuecomment-1494417531
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/plugins')
-rw-r--r-- | searx/plugins/limiter.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/searx/plugins/limiter.py b/searx/plugins/limiter.py index e1cd0e408..2a9e6f8f5 100644 --- a/searx/plugins/limiter.py +++ b/searx/plugins/limiter.py @@ -47,6 +47,9 @@ def is_accepted_request() -> bool: user_agent = request.headers.get('User-Agent', 'unknown') x_forwarded_for = request.headers.get('X-Forwarded-For', '') + if request.path == '/healthz': + return True + if block_user_agent.match(user_agent): logger.debug("BLOCK %s: %s --> detected User-Agent: %s" % (x_forwarded_for, request.path, user_agent)) return False |