Merge remote-tracking branch 'origin/stable'

# Conflicts:
#	package-lock.json
#	package.json
#	src/services/build.js
This commit is contained in:
zadam
2022-07-01 22:34:19 +02:00
8 changed files with 69 additions and 25 deletions

View File

@@ -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);