add a test
This commit is contained in:
parent
5ff92c6452
commit
527e9f09c9
3 changed files with 29 additions and 5 deletions
|
@ -160,6 +160,7 @@ function download(id, keychain, onprogress, canceller) {
|
|||
resolve(this.result);
|
||||
};
|
||||
});
|
||||
|
||||
xhr.addEventListener('progress', function(event) {
|
||||
if (event.lengthComputable && event.target.status === 200) {
|
||||
onprogress([event.loaded, event.total]);
|
||||
|
@ -168,8 +169,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]);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue