The upstream gcp aggressively closes the connection once it has
received Content-Length bytes. However the @google-cloud/storage
module doesn't handle this well and emits no event in this case.
We were setting Content-Length because it's slightly more
efficient and was important for our download progress
bar (not anymore). The download should function fine without
setting the Content-Length, and allows the storage stream to finish
before closing the upstream socket.
This commit is contained in:
Danny Coates 2018-11-14 09:50:12 -08:00
parent e264d0da62
commit 6184a70ba4
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
4 changed files with 7 additions and 16 deletions

View file

@ -13,7 +13,7 @@ class GCSStorage {
}
getStream(id) {
return this.bucket.file(id).createReadStream();
return this.bucket.file(id).createReadStream({ validation: false });
}
set(id, file) {