mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-25 22:55:52 -05:00
Fixed Telegram proxy issue (#4703)
This commit is contained in:
parent
3a22bfbc24
commit
60af01a165
@ -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;
|
||||
|
@ -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'];
|
||||
|
Loading…
Reference in New Issue
Block a user