diff --git a/common.js b/common.js index 68403aaf..74747db5 100644 --- a/common.js +++ b/common.js @@ -142,9 +142,12 @@ module.exports.zeroPad = function(num, c) { if (c == null) { c = 2; } var s = '0 // Lowercase all the names in a object recursively // Allow for exception keys, child of exceptions will not get lower-cased. -module.exports.objKeysToLower = function (obj, exceptions) { +// Exceptions is an array of "keyname" or "parent\keyname" +module.exports.objKeysToLower = function (obj, exceptions, parent) { for (var i in obj) { - if ((typeof obj[i] == 'object') && ((exceptions == null) || (exceptions.indexOf(i.toLowerCase()) == -1))) { module.exports.objKeysToLower(obj[i], exceptions); } // LowerCase all key names in the child object + if ((typeof obj[i] == 'object') && ((exceptions == null) || (exceptions.indexOf(i.toLowerCase()) == -1)) && ((parent != null) && (exceptions.indexOf(parent.toLowerCase() + '/' + i.toLowerCase()) == -1))) { + module.exports.objKeysToLower(obj[i], exceptions, i); // LowerCase all key names in the child object + } if (i.toLowerCase() !== i) { obj[i.toLowerCase()] = obj[i]; delete obj[i]; } // LowerCase all key names } return obj; diff --git a/meshcentral.js b/meshcentral.js index ac491f38..49d13f31 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -1202,7 +1202,7 @@ function CreateMeshCentralServer(config, args) { for (i in args) { config2.settings[i] = args[i]; } // Lower case all keys in the config file - common.objKeysToLower(config2, ['ldapoptions', 'defaultuserwebstate', 'forceduserwebstate', 'httpheaders']); + common.objKeysToLower(config2, ['ldapoptions', 'defaultuserwebstate', 'forceduserwebstate', 'httpheaders', 'telegram/proxy']); // Grab some of the values from the original config.json file if present. config2['mysql'] = config['mysql'];