diff --git a/libraries/object-persistor/src/GcsPersistor.js b/libraries/object-persistor/src/GcsPersistor.js index fc9cd111fb..b4dcdbdaed 100644 --- a/libraries/object-persistor/src/GcsPersistor.js +++ b/libraries/object-persistor/src/GcsPersistor.js @@ -102,7 +102,7 @@ module.exports = class GcsPersistor extends AbstractPersistor { const stream = this.storage .bucket(bucketName) .file(key) - .createReadStream(opts) + .createReadStream({ decompress: false, ...opts }) // ingress to us from gcs const observer = new PersistorHelper.ObserverStream({ diff --git a/libraries/object-persistor/test/unit/GcsPersistorTests.js b/libraries/object-persistor/test/unit/GcsPersistorTests.js index 4fa52c3053..70e1666c8c 100644 --- a/libraries/object-persistor/test/unit/GcsPersistorTests.js +++ b/libraries/object-persistor/test/unit/GcsPersistorTests.js @@ -160,6 +160,12 @@ describe('GcsPersistorTests', function () { expect(GcsFile.createReadStream).to.have.been.called }) + it('disables automatic decompression', function () { + expect(GcsFile.createReadStream).to.have.been.calledWith({ + decompress: false + }) + }) + it('pipes the stream through the meter', function () { expect(ReadStream.pipe).to.have.been.calledWith( sinon.match.instanceOf(Transform) @@ -183,6 +189,7 @@ describe('GcsPersistorTests', function () { it('passes the byte range on to GCS', function () { expect(GcsFile.createReadStream).to.have.been.calledWith({ + decompress: false, start: 5, end: 10 })