fix ip address matching on getdomain

This commit is contained in:
Kyle Spearrin 2019-05-31 08:30:18 -04:00
parent 46e631388d
commit ac6f3a6bb6
2 changed files with 6 additions and 3 deletions

View file

@ -63,8 +63,11 @@ namespace Bit.App.Pages
{
name = Uri.Substring(Constants.AndroidAppProtocol.Length);
}
else if(!System.Uri.TryCreate(Uri, UriKind.Absolute, out Uri uri) ||
!DomainName.TryParseBaseDomain(uri.Host, out name))
else
{
name = CoreHelpers.GetDomain(Uri);
}
if(string.IsNullOrWhiteSpace(name))
{
name = "--";
}

View file

@ -63,7 +63,7 @@ namespace Bit.Core.Utilities
return null;
}
if(uri.Host == "localhost" || Regex.IsMatch(uriString, IpRegex))
if(uri.Host == "localhost" || Regex.IsMatch(uri.Host, IpRegex))
{
return uri.Host;
}