Skip to content

Node.js based forum software built for the modern web

No 404 responses for missing language files

Peter Jaszkowiakf0c941e5aeef
diff --git a/src/routes/index.js b/src/routes/index.js
index 99ff3a7f27..d33fd316b5 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -157,6 +157,11 @@ module.exports = function (app, middleware, hotswapIds) {
res.redirect(relativePath + '/assets/language' + req.path + '.json?' + meta.config['cache-buster']);
});
+ // stop 404's on `/assets/language` route
+ app.use(relativePath + '/assets/language', function (req, res) {
+ res.json({});
+ });
+
app.use(relativePath, express.static(path.join(__dirname, '../../', 'public'), {
maxAge: app.enabled('cache') ? 5184000000 : 0
}));