diff --git a/tools/SetupFlow/DevHome.SetupFlow/ViewModels/AddRepoViewModel.cs b/tools/SetupFlow/DevHome.SetupFlow/ViewModels/AddRepoViewModel.cs index b0d2c78922..3498c324e9 100644 --- a/tools/SetupFlow/DevHome.SetupFlow/ViewModels/AddRepoViewModel.cs +++ b/tools/SetupFlow/DevHome.SetupFlow/ViewModels/AddRepoViewModel.cs @@ -1184,7 +1184,7 @@ private void ValidateUriAndChangeUiIfBad(string url, out Uri uri) uri = null; // If the url isn't valid don't bother finding a provider. - if (!Uri.IsWellFormedUriString(url, UriKind.Absolute) || + if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute) || !Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out uri)) { UrlParsingError = _stringResource.GetLocalized(StringResourceKey.UrlValidationBadUrl); @@ -1198,8 +1198,11 @@ private void ValidateUriAndChangeUiIfBad(string url, out Uri uri) { try { - var uriBuilder = new UriBuilder(uri.OriginalString); - uriBuilder.Port = -1; + var uriBuilder = new UriBuilder(schemeName: Uri.UriSchemeHttps, hostName: uri.OriginalString) + { + Port = -1, + }; + uri = uriBuilder.Uri; } catch (Exception e)