mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-08 07:00:54 +03:00
added downloadConfirm string to noStream page
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user