Skip to content

Node.js based forum software built for the modern web

fix: send hard 404 instead of soft 404 for missing modules

Julian Lam9f3b78118ac0
diff --git a/src/controllers/404.js b/src/controllers/404.js
index 3e93c4ac32..eb9f94c8d8 100644
--- a/src/controllers/404.js
+++ b/src/controllers/404.js
@@ -21,7 +21,7 @@ exports.handle404 = function handle404(req, res) {
}
if (isClientScript.test(req.url)) {
- res.type('text/javascript').status(200).send('');
+ res.type('text/javascript').status(404).send('Not Found');
} else if (req.path.startsWith(relativePath + '/assets/uploads') || (req.get('accept') && !req.get('accept').includes('text/html')) || req.path === '/favicon.ico') {
meta.errors.log404(req.path || '');
res.sendStatus(404);