aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2018-10-15 17:05:46 +0200
committerJohannes Zellner <johannes@cloudron.io>2018-10-15 17:05:46 +0200
commit4d8f08f9c825c35ed3e05ce92457c2fc2e2194c6 (patch)
treebacd7702228958b0c22efe55f51a526502b49a9e
parent459517d3c026aaa694be2be5f5b2f66a9df49399 (diff)
downloadSurfer-4d8f08f9c825c35ed3e05ce92457c2fc2e2194c6.tar.gz
Surfer-4d8f08f9c825c35ed3e05ce92457c2fc2e2194c6.tar.zst
Surfer-4d8f08f9c825c35ed3e05ce92457c2fc2e2194c6.zip
Corretly send 404 status codes
-rw-r--r--CHANGELOG4
-rwxr-xr-xserver.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 397650d..f618691 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -74,4 +74,6 @@
74* Minor interface improvements 74* Minor interface improvements
75 75
76[5.4.0] 76[5.4.0]
77* Use new Cloudron base image \ No newline at end of file 77* Use new Cloudron base image
78* Send 404 status code correctly
79
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) {
93}); 93});
94app.use('/', function (req, res, next) { 94app.use('/', function (req, res, next) {
95 if (config.folderListingEnabled) return next(); 95 if (config.folderListingEnabled) return next();
96 res.sendFile(__dirname + '/frontend/404.html'); 96 res.status(404).sendFile(__dirname + '/frontend/404.html');
97}); 97});
98app.use('/', serveIndex(ROOT_FOLDER, { icons: true })); 98app.use('/', serveIndex(ROOT_FOLDER, { icons: true }));
99app.use(lastMile()); 99app.use(lastMile());