From 74a140d7d9925a0d03545f3664106d8020479c39 Mon Sep 17 00:00:00 2001 From: Dmitry Litus Date: Fri, 23 Nov 2018 16:08:32 +0300 Subject: [PATCH] Fix status code on page not found --- server/controllers/pages.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/controllers/pages.js b/server/controllers/pages.js index c974112c..e278b7a9 100644 --- a/server/controllers/pages.js +++ b/server/controllers/pages.js @@ -231,7 +231,7 @@ router.get('/*', (req, res, next) => { if (pageData) { res.render('pages/view', { pageData }) } else { - res.render('error-notexist', { + res.status(404).render('error-notexist', { newpath: safePath }) } @@ -240,7 +240,7 @@ router.get('/*', (req, res, next) => { if (safePath === 'home') { res.render('pages/welcome') } else { - res.render('error-notexist', { + res.status(404).render('error-notexist', { message: err.message, newpath: safePath })