fox-send/server/routes/exists.js

14 lines
305 B
JavaScript
Raw Permalink Normal View History

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