Bug 1484012: [fetch-content] Transparently decompress artifacts; r=gps

generic-worker transparently compresses uncompressed artifacts. Teach
fetch-content to decompress those artifacts.

Differential Revision: https://phabricator.services.mozilla.com/D3555

--HG--
extra : rebase_source : 3e1847b545de5443fd4349f75acc605ea5a46701
This commit is contained in:
Tom Prince 2018-08-15 15:53:27 -06:00
Родитель 6701e41a4c
Коммит 9fd238c7e3
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -60,6 +60,9 @@ def stream_download(url, sha256=None, size=None):
t0 = time.time()
with urllib.request.urlopen(url) as fh:
if not url.endswith('.gz') and fh.info().get('Content-Encoding') == 'gzip':
fh = gzip.GzipFile(fileobj=fh)
while True:
chunk = fh.read(65536)
if not chunk: