feat : Added ToPrivateString Method to convert password into special characters for privacy.

This commit is contained in:
Laura Gomez
2020-03-16 16:29:57 -04:00
committed by Chris Cameron
parent ac5da50e98
commit 3ebfa76970

View File

@@ -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();
}
}
}