mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: send hard 404 instead of soft 404 for missing modules
We used to send a soft 404 because require.js would error out on a 404, but it seems years ago, error handling was added to the require() call, so a hard 404 will not throw errors to the console
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user