diff options
author | Léon Tiekötter <leon@tiekoetter.com> | 2022-08-25 23:21:12 +0200 |
---|---|---|
committer | Léon Tiekötter <leon@tiekoetter.com> | 2022-08-25 23:21:30 +0200 |
commit | 221740f76e4f3c056828adf0af5dfb0efbcc5c74 (patch) | |
tree | 3683b96f05832fe9c534e029ad1f4b214db2c66b /searx/plugins | |
parent | 5a241e545ed2c64cd71f88a3b46ae4b170b6d883 (diff) | |
download | searxng-221740f76e4f3c056828adf0af5dfb0efbcc5c74.tar.gz searxng-221740f76e4f3c056828adf0af5dfb0efbcc5c74.zip |
[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)
Diffstat (limited to 'searx/plugins')
-rw-r--r-- | searx/plugins/limiter.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 |