mirror of
https://github.com/timvisee/send.git
synced 2025-10-03 17:49:18 +02:00
Begin implementing a reporting mechanism
This commit is contained in:
parent
ccbcb69666
commit
9891d1f0ba
37 changed files with 762 additions and 183 deletions
|
@ -23,14 +23,17 @@ module.exports = {
|
|||
const id = req.params.id;
|
||||
const appState = await state(req);
|
||||
try {
|
||||
const { nonce, pwd } = await storage.metadata(id);
|
||||
const { nonce, pwd, dead, flagged } = await storage.metadata(id);
|
||||
if (dead && !flagged) {
|
||||
return next();
|
||||
}
|
||||
res.set('WWW-Authenticate', `send-v1 ${nonce}`);
|
||||
res.send(
|
||||
stripEvents(
|
||||
routes().toString(
|
||||
`/download/${id}`,
|
||||
Object.assign(appState, {
|
||||
downloadMetadata: { nonce, pwd }
|
||||
downloadMetadata: { nonce, pwd, flagged }
|
||||
})
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue