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

@@ -250,7 +250,8 @@ export default function(state, emitter) {
const start = Date.now();
try {
const dl = state.transfer.download({
stream: state.capabilities.streamDownload
stream: state.capabilities.streamDownload,
storage: state.storage
});
render();
await dl;
@@ -269,7 +270,9 @@ export default function(state, emitter) {
} else {
// eslint-disable-next-line no-console
state.transfer = null;
const location = err.message === '404' ? '/404' : '/error';
const location = ['404', '403'].includes(err.message)
? '/404'
: '/error';
if (location === '/error') {
state.sentry.withScope(scope => {
scope.setExtra('duration', err.duration);