set correct content type for error messages

This commit is contained in:
zadam
2022-07-01 00:01:29 +02:00
parent fac9fef652
commit 3faae63b84
9 changed files with 71 additions and 27 deletions

View File

@@ -48,7 +48,9 @@ function downloadNoteFile(noteId, res, contentDisposition = true) {
const note = becca.getNote(noteId);
if (!note) {
return res.status(404).send(`Note ${noteId} doesn't exist.`);
return res.setHeader("Content-Type", "text/plain")
.status(404)
.send(`Note ${noteId} doesn't exist.`);
}
if (note.isProtected && !protectedSessionService.isProtectedSessionAvailable()) {