From 221740f76e4f3c056828adf0af5dfb0efbcc5c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9on=20Tiek=C3=B6tter?= Date: Thu, 25 Aug 2022 23:21:12 +0200 Subject: [PATCH] [mod] limiter plugin: Accept-Encoding handling Only raise "suspicious Accept-Encoding" when both "gzip" and "deflate" are missing from Accept-Encoding. Prevent Browsers which only implement one compression solution from being blocked by the limiter plugin. Example Browser which is currently blocked: Lynx Browser (https://lynx.invisible-island.net) --- searx/plugins/limiter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/plugins/limiter.py b/searx/plugins/limiter.py index c9aa36265..c6f5d6a0f 100644 --- a/searx/plugins/limiter.py +++ b/searx/plugins/limiter.py @@ -67,7 +67,7 @@ def is_accepted_request() -> bool: return False accept_encoding_list = [l.strip() for l in request.headers.get('Accept-Encoding', '').split(',')] - if 'gzip' not in accept_encoding_list or 'deflate' not in accept_encoding_list: + if 'gzip' not in accept_encoding_list and 'deflate' not in accept_encoding_list: logger.debug("suspicious Accept-Encoding") # pylint: disable=undefined-variable return False