1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-13 06:32:34 +01:00
send/server/routes/exists.js

14 lines
305 B
JavaScript
Raw Normal View History

const storage = require('../storage');
module.exports = async (req, res) => {
try {
2018-02-06 23:31:18 +01:00
const meta = await storage.metadata(req.params.id);
res.set('WWW-Authenticate', `send-v1 ${meta.nonce}`);
res.send({
2018-07-31 20:09:18 +02:00
requiresPassword: meta.pwd
});
} catch (e) {
res.sendStatus(404);
}
};