fix password filter actually sets password to ****
This commit is contained in:
@@ -17,6 +17,26 @@ class WTVShared {
|
|||||||
minisrv_config = [];
|
minisrv_config = [];
|
||||||
|
|
||||||
constructor(minisrv_config, quiet = false) {
|
constructor(minisrv_config, quiet = false) {
|
||||||
|
Object.prototype.clone = Array.prototype.clone = function () {
|
||||||
|
if (Object.prototype.toString.call(this) === '[object Array]') {
|
||||||
|
var clone = [];
|
||||||
|
for (var i = 0; i < this.length; i++)
|
||||||
|
clone[i] = this[i].clone();
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
|
else if (typeof (this) == "object") {
|
||||||
|
var clone = {};
|
||||||
|
for (var prop in this)
|
||||||
|
if (this.hasOwnProperty(prop))
|
||||||
|
clone[prop] = this[prop].clone();
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
if (minisrv_config == null) this.minisrv_config = this.readMiniSrvConfig(true, !quiet);
|
if (minisrv_config == null) this.minisrv_config = this.readMiniSrvConfig(true, !quiet);
|
||||||
else this.minisrv_config = minisrv_config;
|
else this.minisrv_config = minisrv_config;
|
||||||
|
|
||||||
@@ -392,7 +412,7 @@ class WTVShared {
|
|||||||
return obj.substr(0, 6) + ('*').repeat(9);
|
return obj.substr(0, 6) + ('*').repeat(9);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var newobj = Object.assign({}, obj);
|
var newobj = obj.clone();
|
||||||
if (obj.post_data) newobj.post_data = obj.post_data;
|
if (obj.post_data) newobj.post_data = obj.post_data;
|
||||||
if (newobj["wtv-client-serial-number"]) {
|
if (newobj["wtv-client-serial-number"]) {
|
||||||
var ssid = newobj["wtv-client-serial-number"];
|
var ssid = newobj["wtv-client-serial-number"];
|
||||||
@@ -414,8 +434,7 @@ class WTVShared {
|
|||||||
filterRequestLog(obj) {
|
filterRequestLog(obj) {
|
||||||
if (this.minisrv_config.config.filter_passwords_in_logs === true) {
|
if (this.minisrv_config.config.filter_passwords_in_logs === true) {
|
||||||
if (obj.query) {
|
if (obj.query) {
|
||||||
var newobj = Object.assign({}, obj);
|
var newobj = obj.clone();
|
||||||
if (obj.post_data) newobj.post_data = obj.post_data;
|
|
||||||
Object.keys(newobj.query).forEach(function (k) {
|
Object.keys(newobj.query).forEach(function (k) {
|
||||||
var key = k.toLowerCase();
|
var key = k.toLowerCase();
|
||||||
switch (true) {
|
switch (true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user