expired ids should reject instead of returning null

This commit is contained in:
Danny Coates 2017-07-25 12:00:52 -07:00
parent 0761fcf902
commit 15ac0e1d49
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
2 changed files with 8 additions and 9 deletions

View file

@ -117,7 +117,7 @@ app.get('/download/:id', (req, res) => {
}
storage.filename(id).then(filename => {
storage
return storage
.length(id)
.then(contentLength => {
storage.ttl(id).then(timeToExpiry => {
@ -128,11 +128,11 @@ app.get('/download/:id', (req, res) => {
timeToExpiry: timeToExpiry
});
});
})
.catch(() => {
res.status(404).render('notfound');
});
});
})
.catch(() => {
res.status(404).render('notfound');
});;
});
app.get('/assets/download/:id', (req, res) => {