added content-length to sw response
This commit is contained in:
parent
ddeaf8076d
commit
5677390a45
|
@ -108,6 +108,7 @@ export default class FileReceiver extends Nanobus {
|
|||
requiresPassword: this.fileInfo.requiresPassword,
|
||||
password: this.fileInfo.password,
|
||||
url: this.fileInfo.url,
|
||||
size: this.fileInfo.size,
|
||||
noSave
|
||||
};
|
||||
await this.sendMessageToSw(info);
|
||||
|
|
|
@ -33,7 +33,8 @@ async function decryptStream(request) {
|
|||
const decrypted = file.keychain.decryptStream(readStream);
|
||||
|
||||
const headers = {
|
||||
'Content-Disposition': 'attachment; filename=' + file.filename
|
||||
'Content-Disposition': 'attachment; filename=' + file.filename,
|
||||
'Content-Length': file.size
|
||||
};
|
||||
|
||||
return new Response(decrypted, { headers });
|
||||
|
@ -60,6 +61,7 @@ self.onmessage = event => {
|
|||
const info = {
|
||||
keychain: new Keychain(event.data.key),
|
||||
filename: event.data.filename,
|
||||
size: event.data.size,
|
||||
progress: 0,
|
||||
cancelled: false
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue