Added multiple download option

This commit is contained in:
Danny Coates 2017-11-30 13:41:09 -08:00
parent beb3a6e67b
commit 7b4060f9e1
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
22 changed files with 1159 additions and 453 deletions

View file

@ -12,9 +12,12 @@ module.exports = function(req, res) {
if (!metadata || !auth) {
return res.sendStatus(400);
}
const owner = crypto.randomBytes(10).toString('hex');
const meta = {
delete: crypto.randomBytes(10).toString('hex'),
dlimit: 1,
dl: 0,
owner,
delete: owner, // delete is deprecated
metadata,
pwd: 0,
auth: auth.split(' ')[1],
@ -30,7 +33,7 @@ module.exports = function(req, res) {
res.set('WWW-Authenticate', `send-v1 ${meta.nonce}`);
res.json({
url,
delete: meta.delete,
owner: meta.owner,
id: newId
});
} catch (e) {