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
v1.18.x
Julian Lam 5 years ago
parent 8032c8bdfe
commit 9f3b78118a

@ -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);

Loading…
Cancel
Save