jfc that was pathetic... fix error handling

pull/1/head
2023-12-24 23:55:14 +01:00
parent fb8ee6dca3
commit eecb2b5c39
1 changed files with 5 additions and 2 deletions

View File

@ -32,7 +32,7 @@ router.get(
req.params.address,
req.params.uid
)
if (mail && !mail == "womp womp") {
if (mail && mail != "womp womp") {
// Emails are immutable, cache if found
res.set('Cache-Control', 'private, max-age=600')
res.render('mail', {
@ -44,7 +44,10 @@ router.get(
madebysite: config.branding[2]
})
} else {
next({message: 'This mail could not be found. It either does not exist or has been deleted from our servers!', status: 404})
next({
message: 'This mail could not be found. It either does not exist or has been deleted from our servers!',
status: 404
})
}
} catch (error) {
console.error('error while fetching one email', error)