Introduce a function that redacts passwords in URIs
This commit is contained in:
parent
7262b5c65d
commit
140d604b0e
|
|
@ -567,6 +567,16 @@ function fmt_shortened_uri(uri) {
|
|||
}
|
||||
}
|
||||
|
||||
function fmt_uri_with_credentials(uri) {
|
||||
if (typeof uri == 'string') {
|
||||
// mask password
|
||||
var mask = /^([a-zA-Z0-9]+):\/\/(.*):(.*)@/;
|
||||
return uri.replace(mask, "$1://$2:[redacted]@");
|
||||
} else {
|
||||
return UNKNOWN_REPR;
|
||||
}
|
||||
}
|
||||
|
||||
function fmt_client_name(properties) {
|
||||
var res = [];
|
||||
if (properties.product != undefined) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue