mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
corrected handling with http response headers
This commit is contained in:
parent
f1ce7c0cf9
commit
8dddfb9c05
@ -121,7 +121,7 @@ def format_price_in_RUR(price):
|
|||||||
|
|
||||||
def ungzipResponse(r,b):
|
def ungzipResponse(r,b):
|
||||||
headers = r.info()
|
headers = r.info()
|
||||||
if headers['Content-Encoding']=='gzip':
|
if headers.get('Content-Encoding', '')=='gzip':
|
||||||
import gzip
|
import gzip
|
||||||
gz = gzip.GzipFile(fileobj=r, mode='rb')
|
gz = gzip.GzipFile(fileobj=r, mode='rb')
|
||||||
data = gz.read()
|
data = gz.read()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user