correct gzip detection

do not decode stream content for binary comparison
This commit is contained in:
Tonsofattraction 2015-08-24 15:12:02 +03:00
parent 8a776a3ffc
commit 94fa7b58e4

View File

@ -210,7 +210,7 @@ class HttpOpener(object):
stream = requests.get(self.url, stream=True, verify=False)
if stream.status_code == 200:
try:
stream_iterator = stream.raw.stream(2, decode_content=True)
stream_iterator = stream.raw.stream(2)
gz_header = stream_iterator.next()
if gz_header[:2] == b'\037\213':
logging.info("Ammofile data is in gz format")