mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
feat : Added ToPrivateString Method to convert password into special characters for privacy.
This commit is contained in:
committed by
Chris Cameron
parent
ac5da50e98
commit
3ebfa76970
@@ -46,5 +46,21 @@ namespace ICD.Common.Utils.Extensions
|
||||
|
||||
return extends.ToString() == "http://localhost/";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string representation of the given URI, replacing the password with asterixes.
|
||||
/// </summary>
|
||||
/// <param name="extends"></param>
|
||||
/// <returns></returns>
|
||||
public static string ToPrivateString([NotNull] this Uri extends)
|
||||
{
|
||||
if (extends == null)
|
||||
throw new ArgumentNullException("extends");
|
||||
|
||||
IcdUriBuilder builder = new IcdUriBuilder(extends);
|
||||
builder.Password = builder.Password == null ? null : StringUtils.PasswordFormat(builder.Password);
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user