mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-04 14:50:47 +01:00
Fix reverse proxies breaking admin translations
This commit is contained in:
@@ -185,7 +185,7 @@ middleware.applyBlacklist = function (req, res, next) {
|
||||
|
||||
middleware.getTranslation = function (req, res, next) {
|
||||
var language = req.params.language;
|
||||
var namespace = req.params.namespace;
|
||||
var namespace = req.params[0];
|
||||
|
||||
if (language && namespace) {
|
||||
languages.get(language, namespace, function (err, translations) {
|
||||
|
||||
@@ -144,7 +144,7 @@ module.exports = function (app, middleware, hotswapIds) {
|
||||
}
|
||||
|
||||
app.use(middleware.privateUploads);
|
||||
app.use(relativePath + '/api/language/:language/:namespace', middleware.getTranslation);
|
||||
app.use(relativePath + '/api/language/:language/(([a-zA-Z0-9\\-_.\\/]+))', middleware.getTranslation);
|
||||
app.use(relativePath, express.static(path.join(__dirname, '../../', 'public'), {
|
||||
maxAge: app.enabled('cache') ? 5184000000 : 0
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user