diff --git a/src/App/Models/Page/VaultViewLoginPageModel.cs b/src/App/Models/Page/VaultViewLoginPageModel.cs index 7948deb50..dabd31292 100644 --- a/src/App/Models/Page/VaultViewLoginPageModel.cs +++ b/src/App/Models/Page/VaultViewLoginPageModel.cs @@ -126,26 +126,19 @@ public string UriHost return _uriHost; } - try + Uri uri; + if(!System.Uri.TryCreate(Uri, UriKind.Absolute, out uri)) { - var host = new Uri(Uri).Host; - - DomainName domain; - if(DomainName.TryParse(host, out domain)) - { - _uriHost = domain.BaseDomain; - } - else - { - _uriHost = host; - } - - return _uriHost; + return Uri; } - catch + + DomainName domain; + if(DomainName.TryParse(uri.Host, out domain)) { - return Uri; + return domain.BaseDomain; } + + return uri.Host; } }