mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #9 from overleaf/em-disable-gcs-decompress
Disable auto-decompression in GCS persistor
This commit is contained in:
commit
2fd9b6c61b
2 changed files with 8 additions and 1 deletions
|
@ -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({
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue