mirror of https://github.com/scrapy/scrapy.git
Do not decode of head response (2)
This commit is contained in:
parent
a9c73601ca
commit
9e3da69867
|
|
@ -20,6 +20,9 @@ class HttpCompressionMiddleware(object):
|
|||
request.headers.setdefault('Accept-Encoding', 'gzip,deflate')
|
||||
|
||||
def process_response(self, request, response, spider):
|
||||
|
||||
if request.method == 'HEAD':
|
||||
return response
|
||||
if isinstance(response, Response):
|
||||
content_encoding = response.headers.getlist('Content-Encoding')
|
||||
if content_encoding and not is_gzipped(response):
|
||||
|
|
|
|||
Loading…
Reference in New Issue