extracted blobSlicer, fixed download cancel tests

This commit is contained in:
Danny Coates 2018-07-25 12:29:19 -07:00
parent 5483dc2506
commit 5e9e63944b
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
6 changed files with 58 additions and 58 deletions

View file

@ -15,8 +15,11 @@ self.addEventListener('activate', event => {
});
async function decryptStream(id) {
const file = map.get(id);
if (!file) {
return new Response(null, { status: 400 });
}
try {
const file = map.get(id);
const keychain = new Keychain(file.key, file.nonce);
if (file.requiresPassword) {
keychain.setPassword(file.password, file.url);