diff --git a/app/ui/noStreams.js b/app/ui/noStreams.js index d31ad777..52cb7d05 100644 --- a/app/ui/noStreams.js +++ b/app/ui/noStreams.js @@ -19,9 +19,9 @@ module.exports = function(state, emit) {
- + + +

${ archive.name @@ -55,6 +55,11 @@ module.exports = function(state, emit) { value="${state.translate('copyLinkButton')}" title="${state.translate('copyLinkButton')}" type="submit" /> +

+ ${state.translate('downloadConfirmDescription')} +

`; @@ -64,6 +69,7 @@ module.exports = function(state, emit) { const choice = event.target.value; const button = event.currentTarget.nextElementSibling; let title = button.title; + console.error(choice, title); switch (choice) { case 'copy': title = state.translate('copyLinkButton'); diff --git a/server/routes/done.js b/server/routes/done.js index d33c9882..8c61a084 100644 --- a/server/routes/done.js +++ b/server/routes/done.js @@ -15,7 +15,13 @@ module.exports = async function(req, res) { agent: req.ua.browser.name || req.ua.ua.substring(0, 6) }); await storage.incrementField(id, 'dl'); - if (meta.dlToken >= meta.dlimit) { + if (meta.dl + 1 >= meta.dlimit) { + // Only dlimit number of tokens will be issued + // after which /download/token will return 403 + // however the protocol doesn't prevent one token + // from making all the downloads and assumes + // clients are well behaved. If this becomes + // a problem we can keep track of used tokens. await storage.kill(id); } res.sendStatus(200);