Merge branch 'vnext' into sw

This commit is contained in:
Danny Coates 2018-07-13 12:27:39 -07:00
commit 23c347175a
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
48 changed files with 431 additions and 234 deletions

View file

@ -270,6 +270,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]);
@ -278,8 +279,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]);
});
}