added downloadConfirm string to noStream page

This commit is contained in:
Danny Coates
2020-07-29 12:35:47 -07:00
parent 81e9d81dab
commit e2425cd6c9
2 changed files with 16 additions and 4 deletions

View File

@@ -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);