mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
set correct content type for error messages
This commit is contained in:
@@ -65,11 +65,15 @@ function downloadNoteRevision(req, res) {
|
||||
const noteRevision = becca.getNoteRevision(req.params.noteRevisionId);
|
||||
|
||||
if (noteRevision.noteId !== req.params.noteId) {
|
||||
return res.status(400).send(`Note revision ${req.params.noteRevisionId} does not belong to note ${req.params.noteId}`);
|
||||
return res.setHeader("Content-Type", "text/plain")
|
||||
.status(400)
|
||||
.send(`Note revision ${req.params.noteRevisionId} does not belong to note ${req.params.noteId}`);
|
||||
}
|
||||
|
||||
if (noteRevision.isProtected && !protectedSessionService.isProtectedSessionAvailable()) {
|
||||
return res.status(401).send("Protected session not available");
|
||||
return res.setHeader("Content-Type", "text/plain")
|
||||
.status(401)
|
||||
.send("Protected session not available");
|
||||
}
|
||||
|
||||
const filename = getRevisionFilename(noteRevision);
|
||||
|
||||
Reference in New Issue
Block a user