From 03f94962b63eb8e189b0b4983c0329d0c29c34ab Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 3 Apr 2023 19:36:28 +0200 Subject: [PATCH] [fix] limiter: never block a /healthz request Related: https://github.com/searxng/searxng/issues/2310#issuecomment-1494417531 Signed-off-by: Markus Heiser --- searx/plugins/limiter.py | 3 +++ 1 file changed, 3 insertions(+) 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