diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Uri.UnitTests/UriHelper/ExtendedUriParserTests.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Uri.UnitTests/UriHelper/ExtendedUriParserTests.cs index de1ad66d56..84edf307d8 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Uri.UnitTests/UriHelper/ExtendedUriParserTests.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Uri.UnitTests/UriHelper/ExtendedUriParserTests.cs @@ -15,7 +15,7 @@ namespace Microsoft.Plugin.Uri.UnitTests.UriHelper [TestCase("localhost", true, "http://localhost/")] [TestCase("127.0.0.1", true, "http://127.0.0.1/")] [TestCase("127.0.0.1:80", true, "http://127.0.0.1/")] - [TestCase("127", true, "http://0.0.0.127/")] + [TestCase("127", false, null)] [TestCase("", false, null)] [TestCase("https://google.com", true, "https://google.com/")] [TestCase("ftps://google.com", true, "ftps://google.com/")] diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Uri/UriHelper/ExtendedUriParser.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Uri/UriHelper/ExtendedUriParser.cs index bb3b263336..7605ccfc65 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Uri/UriHelper/ExtendedUriParser.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Uri/UriHelper/ExtendedUriParser.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using System.Linq; using Microsoft.Plugin.Uri.Interfaces; namespace Microsoft.Plugin.Uri.UriHelper @@ -21,7 +22,8 @@ namespace Microsoft.Plugin.Uri.UriHelper // Using CurrentCulture since this is a user typed string if (input.EndsWith(":", StringComparison.CurrentCulture) || input.EndsWith(".", StringComparison.CurrentCulture) - || input.EndsWith(":/", StringComparison.CurrentCulture)) + || input.EndsWith(":/", StringComparison.CurrentCulture) + || input.All(char.IsDigit)) { result = default; return false;