mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: don't overwrite req.query.lang if it exists
This commit is contained in:
@@ -73,11 +73,11 @@ module.exports = function (middleware) {
|
||||
|
||||
let langs = [];
|
||||
middleware.autoLocale = function autoLocale(req, res, next) {
|
||||
if (parseInt(req.uid, 10) > 0 || !meta.config.autoDetectLang) {
|
||||
if (parseInt(req.uid, 10) > 0 || !meta.config.autoDetectLang || req.query.lang) {
|
||||
return next();
|
||||
}
|
||||
|
||||
var lang = req.acceptsLanguages(langs);
|
||||
const lang = req.acceptsLanguages(langs);
|
||||
if (!lang) {
|
||||
return next();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user