fix: IcdUriBuilder constructors behave closer to UriBuilder, Host defaults to "localhost"

This commit is contained in:
Chris Cameron
2019-05-01 17:05:22 -04:00
parent 78c20201ab
commit 33b1d29781
2 changed files with 14 additions and 13 deletions

View File

@@ -107,20 +107,20 @@ namespace ICD.Common.Utils
/// <returns></returns>
public override string ToString()
{
// URI = scheme:[//authority]path[?query][#fragment]
// URI = [scheme://][authority]path[?query][#fragment]
// authority = [userinfo@]host[:port]
// userinfo = username[:password]
StringBuilder builder = new StringBuilder();
// Scheme
string scheme = string.IsNullOrEmpty(Scheme) ? Uri.UriSchemeHttp : Scheme;
builder.Append(scheme);
builder.Append(':');
if (!string.IsNullOrEmpty(Scheme))
{
builder.Append(Scheme);
builder.Append("://");
}
// Authority
builder.Append("//");
if (!string.IsNullOrEmpty(UserName))
{
builder.Append(UserName);