implemented download tokens

This commit is contained in:
Danny Coates
2020-07-27 11:18:52 -07:00
parent 87d46f7ef5
commit 81e9d81dab
26 changed files with 271 additions and 126 deletions

View File

@@ -2,12 +2,13 @@ import assert from 'assert';
import Archive from '../../../app/archive';
import FileSender from '../../../app/fileSender';
import FileReceiver from '../../../app/fileReceiver';
import storage from '../../../app/storage';
const headless = /Headless/.test(navigator.userAgent);
// TODO: save on headless doesn't work as it used to since it now
// follows a link instead of fetch. Maybe there's a way to make it
// work? For now always set noSave.
const options = { noSave: true || !headless, stream: true }; // only run the saveFile code if headless
const options = { noSave: true || !headless, stream: true, storage }; // only run the saveFile code if headless
// FileSender uses a File in real life but a Blob works for testing
const blob = new Blob([new ArrayBuffer(1024 * 128)], { type: 'text/plain' });