From 7e597226ecb562ae7ca70a5aec9d37c42405aa54 Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Wed, 17 Feb 2021 22:02:47 +0100 Subject: Add HTTP 404 error on non-existent note downloads When FreeURL mode is enabled and you called the /download route, the note was created and the user redirected to the blank note. This is caused because the findNote method automatically creates a note when no existing one is found. This commit adds a new parameter to the findNote method which allows to disable this behaviour. In that case a HTTP 404 error will be returned. Signed-off-by: Erik Michelson --- lib/web/note/controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/web/note/controller.js') diff --git a/lib/web/note/controller.js b/lib/web/note/controller.js index 45aea9e2..94bfa0e2 100644 --- a/lib/web/note/controller.js +++ b/lib/web/note/controller.js @@ -119,7 +119,7 @@ exports.doAction = function (req, res, next) { default: return res.redirect(config.serverURL + '/' + noteId) } - }) + }, null, false) } exports.downloadMarkdown = function (req, res, note) { -- cgit v1.2.3