corrected handling with http response headers

This commit is contained in:
Roman Mukhin 2019-12-16 15:01:21 +01:00
parent f1ce7c0cf9
commit 8dddfb9c05

View File

@ -121,7 +121,7 @@ def format_price_in_RUR(price):
def ungzipResponse(r,b):
headers = r.info()
if headers['Content-Encoding']=='gzip':
if headers.get('Content-Encoding', '')=='gzip':
import gzip
gz = gzip.GzipFile(fileobj=r, mode='rb')
data = gz.read()