mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 22:20:55 +03:00
API changes to accommodate 3rd party clients
This commit is contained in:
@@ -11,8 +11,11 @@ module.exports = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await storage.exists(id);
|
const meta = await storage.metadata(id);
|
||||||
res.sendStatus(200);
|
res.set('WWW-Authenticate', `send-v1 ${meta.nonce}`);
|
||||||
|
res.send({
|
||||||
|
password: meta.pwd
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
res.sendStatus(404);
|
res.sendStatus(404);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ module.exports = async function(req, res) {
|
|||||||
const ttl = await storage.ttl(id);
|
const ttl = await storage.ttl(id);
|
||||||
res.send({
|
res.send({
|
||||||
metadata: meta.metadata,
|
metadata: meta.metadata,
|
||||||
|
dtotal: meta.dl,
|
||||||
|
dlimit: meta.dlimit,
|
||||||
size,
|
size,
|
||||||
ttl
|
ttl
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user