From 7ef061fc173ed7cedb5baa14e08d2ba38fbc06c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 30 Jun 2022 17:10:59 +0200 Subject: [PATCH] HttpCompressionMiddleware: clarify internal comment --- scrapy/downloadermiddlewares/httpcompression.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scrapy/downloadermiddlewares/httpcompression.py b/scrapy/downloadermiddlewares/httpcompression.py index 11407ca46..a3e5b3526 100644 --- a/scrapy/downloadermiddlewares/httpcompression.py +++ b/scrapy/downloadermiddlewares/httpcompression.py @@ -70,8 +70,8 @@ class HttpCompressionMiddleware: ) kwargs = dict(cls=respcls, body=decoded_body) if issubclass(respcls, TextResponse): - # force recalculating the encoding until we make sure the - # responsetypes guessing is reliable + # Force recalculating the encoding based on the new, + # decoded (uncompressed) body. kwargs['encoding'] = None response = response.replace(**kwargs) if not content_encoding: