forked from zaclys/searxng
		
	Merge pull request #2313 from return42/limiter-route-healthz
[fix] limiter: never block a /healthz request
This commit is contained in:
		
						commit
						3ab85db5dd
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue