From 8e8570c357ca252bde5252ee2bd298ac3c3249f3 Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Thu, 10 Jan 2019 11:10:36 -0800 Subject: [PATCH] use blob instead of stream to get file list. fixes #1084 --- app/api.js | 3 ++- app/user.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/api.js b/app/api.js index 49b38358..09f21f41 100644 --- a/app/api.js +++ b/app/api.js @@ -375,7 +375,8 @@ export async function getFileList(bearerToken) { const headers = new Headers({ Authorization: `Bearer ${bearerToken}` }); const response = await fetch(getApiUrl('/api/filelist'), { headers }); if (response.ok) { - return response.body; // stream + const encrypted = await response.blob(); + return encrypted; } throw new Error(response.status); } diff --git a/app/user.js b/app/user.js index ab578e5d..29813a69 100644 --- a/app/user.js +++ b/app/user.js @@ -131,7 +131,7 @@ export default class User { try { const encrypted = await getFileList(this.bearerToken); const decrypted = await streamToArrayBuffer( - decryptStream(encrypted, b64ToArray(this.info.fileListKey)) + decryptStream(blobStream(encrypted), b64ToArray(this.info.fileListKey)) ); list = JSON.parse(textDecoder.decode(decrypted)); } catch (e) {