From: Johannes Zellner Date: Mon, 15 Oct 2018 15:05:46 +0000 (+0200) Subject: Corretly send 404 status codes X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git;a=commitdiff_plain;h=4d8f08f9c825c35ed3e05ce92457c2fc2e2194c6 Corretly send 404 status codes --- diff --git a/CHANGELOG b/CHANGELOG index 397650d..f618691 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -74,4 +74,6 @@ * Minor interface improvements [5.4.0] -* Use new Cloudron base image \ No newline at end of file +* Use new Cloudron base image +* Send 404 status code correctly + diff --git a/server.js b/server.js index 6206103..cc644e6 100755 --- a/server.js +++ b/server.js @@ -93,7 +93,7 @@ app.use('/', function welcomePage(req, res, next) { }); app.use('/', function (req, res, next) { if (config.folderListingEnabled) return next(); - res.sendFile(__dirname + '/frontend/404.html'); + res.status(404).sendFile(__dirname + '/frontend/404.html'); }); app.use('/', serveIndex(ROOT_FOLDER, { icons: true })); app.use(lastMile());