From 5a1d7c038d5811466582c11b70ade3238759dcc0 Mon Sep 17 00:00:00 2001 From: ClaraCrazy Date: Sun, 29 Sep 2024 09:56:35 +0200 Subject: [PATCH] if attachment try if attachment - why? --- infrastructure/web/routes/inbox.js | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/infrastructure/web/routes/inbox.js b/infrastructure/web/routes/inbox.js index fa8f990..04cf3f3 100644 --- a/infrastructure/web/routes/inbox.js +++ b/infrastructure/web/routes/inbox.js @@ -109,23 +109,10 @@ router.get( const attachment = mail.attachments[index]; if (attachment) { try { - if (attachment) { - res.set('Content-Disposition', `attachment; filename=${attachment.filename}`); - res.set('Content-Type', attachment.contentType); - res.send(attachment.content); - return; - } else { - res.render( - 'error', - { - address: req.params.address, - message: 'This attachment could not be found. It either does not exist or has been deleted from our servers!', - madeby: config.http.branding[1], - madebysite: config.http.branding[2], - } - ); - return; - } + res.set('Content-Disposition', `attachment; filename=${attachment.filename}`); + res.set('Content-Type', attachment.contentType); + res.send(attachment.content); + return; } catch (error) { console.error('error while fetching attachment', error); next(error);