mirror of
https://github.com/searxng/searxng.git
synced 2025-12-23 04:00:02 +00:00
[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>
This commit is contained in:
@@ -47,6 +47,9 @@ def is_accepted_request() -> bool:
|
|||||||
user_agent = request.headers.get('User-Agent', 'unknown')
|
user_agent = request.headers.get('User-Agent', 'unknown')
|
||||||
x_forwarded_for = request.headers.get('X-Forwarded-For', '')
|
x_forwarded_for = request.headers.get('X-Forwarded-For', '')
|
||||||
|
|
||||||
|
if request.path == '/healthz':
|
||||||
|
return True
|
||||||
|
|
||||||
if block_user_agent.match(user_agent):
|
if block_user_agent.match(user_agent):
|
||||||
logger.debug("BLOCK %s: %s --> detected User-Agent: %s" % (x_forwarded_for, request.path, user_agent))
|
logger.debug("BLOCK %s: %s --> detected User-Agent: %s" % (x_forwarded_for, request.path, user_agent))
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user