mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-07 14:40:55 +03:00
Merge remote-tracking branch 'origin/master' into vnext
This commit is contained in:
@@ -216,6 +216,7 @@ function download(id, keychain, onprogress, canceller) {
|
||||
const blob = new Blob([xhr.response]);
|
||||
resolve(blob);
|
||||
});
|
||||
|
||||
xhr.addEventListener('progress', function(event) {
|
||||
if (event.lengthComputable && event.target.status === 200) {
|
||||
onprogress([event.loaded, event.total]);
|
||||
@@ -224,8 +225,10 @@ function download(id, keychain, onprogress, canceller) {
|
||||
const auth = await keychain.authHeader();
|
||||
xhr.open('get', `/api/download/${id}`);
|
||||
xhr.setRequestHeader('Authorization', auth);
|
||||
xhr.setRequestHeader('Connection', 'close');
|
||||
xhr.responseType = 'blob';
|
||||
xhr.send();
|
||||
onprogress([0, 1]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user