mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-07 14:40:55 +03:00
18 lines
359 B
JavaScript
18 lines
359 B
JavaScript
module.exports = async function(req, res) {
|
|
const meta = req.meta;
|
|
try {
|
|
if (meta.dead || meta.flagged) {
|
|
return res.sendStatus(404);
|
|
}
|
|
const token = await meta.getDownloadToken();
|
|
res.send({
|
|
token
|
|
});
|
|
} catch (e) {
|
|
if (e.message === 'limit') {
|
|
return res.sendStatus(403);
|
|
}
|
|
res.sendStatus(404);
|
|
}
|
|
};
|