[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)
This commit is contained in:
Léon Tiekötter 2022-08-25 23:21:12 +02:00
parent 5a241e545e
commit 221740f76e
No known key found for this signature in database
GPG Key ID: 02869F7817D9EC08
1 changed files with 1 additions and 1 deletions

View File

@ -67,7 +67,7 @@ def is_accepted_request() -> bool:
return False return False
accept_encoding_list = [l.strip() for l in request.headers.get('Accept-Encoding', '').split(',')] 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 logger.debug("suspicious Accept-Encoding") # pylint: disable=undefined-variable
return False return False