mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-07 14:40:55 +03:00
fixes #1005
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:
@@ -47,7 +47,7 @@ export default class FileReceiver extends Nanobus {
|
||||
this.fileInfo.name = meta.name;
|
||||
this.fileInfo.type = meta.type;
|
||||
this.fileInfo.iv = meta.iv;
|
||||
this.fileInfo.size = meta.size;
|
||||
this.fileInfo.size = +meta.size;
|
||||
this.state = 'ready';
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export default class FileReceiver extends Nanobus {
|
||||
this.fileInfo.id,
|
||||
this.keychain,
|
||||
p => {
|
||||
this.progress = p;
|
||||
this.progress = [p, this.fileInfo.size];
|
||||
this.emit('progress');
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user