mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 07:45:51 +01:00
better error message in image attachment + upgrades
This commit is contained in:
@@ -55,7 +55,9 @@ function returnAttachedImage(req, res) {
|
||||
}
|
||||
|
||||
if (!["image"].includes(attachment.role)) {
|
||||
return res.sendStatus(400);
|
||||
return res.setHeader("Content-Type", "text/plain")
|
||||
.status(400)
|
||||
.send(`Attachment '${attachment.attachmentId}' has role '${attachment.role}', but 'image' was expected.`);
|
||||
}
|
||||
|
||||
res.set('Content-Type', attachment.mime);
|
||||
|
||||
Reference in New Issue
Block a user