Skip to content

Commit

Permalink
Trying with passing init crawler scrapy#1988
Browse files Browse the repository at this point in the history
  • Loading branch information
cwen13 committed Sep 16, 2019
1 parent 96a8dfc commit 9010d9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scrapy/downloadermiddlewares/httpcompression.py
Expand Up @@ -19,10 +19,10 @@ class HttpCompressionMiddleware(object):
"""This middleware allows compressed (gzip, deflate) traffic to be
sent/received from web sites"""

def __int__(self, settings):
def __int__(self, crawler):
#setting to decide to keep or discard encoding header
#stored in default_settings.py
self.keep_encoding_header = settings.getbool('HTTPCOMPRESSION_HEADERS_KEEP')
self.keep_encoding_header = crawler.settings.getbool('HTTPCOMPRESSION_HEADERS_KEEP')

@classmethod
def from_crawler(cls, crawler):
Expand Down

0 comments on commit 9010d9f

Please sign in to comment.