1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-10 05:02:45 +01:00

Merge pull request #683 from ehuggett/issue618

API changes to accommodate 3rd party clients
This commit is contained in:
Danny Coates 2018-01-11 13:57:30 -08:00 committed by GitHub
commit 50ba8bec5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -11,8 +11,11 @@ module.exports = async (req, res) => {
}
try {
await storage.exists(id);
res.sendStatus(200);
const meta = await storage.metadata(id);
res.set('WWW-Authenticate', `send-v1 ${meta.nonce}`);
res.send({
password: meta.pwd !== '0'
});
} catch (e) {
res.sendStatus(404);
}

View File

@ -29,6 +29,8 @@ module.exports = async function(req, res) {
const ttl = await storage.ttl(id);
res.send({
metadata: meta.metadata,
dtotal: +meta.dl,
dlimit: +meta.dlimit,
size,
ttl
});