Skip to content

Commit

Permalink
Revert "Fix Uri.Host for IPv6 Link-local address (dotnet/corefx#29769)…
Browse files Browse the repository at this point in the history
…" (dotnet/corefx#29818)

This reverts commit dotnet/corefx@e1ded5a.

Commit migrated from dotnet/corefx@18a84ea
  • Loading branch information
stephentoub authored May 21, 2018
1 parent 1c9d346 commit 5623812
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal static string ParseCanonicalName(string str, int start, ref bool isLoop
((long*)numbers)[0] = 0L;
((long*)numbers)[1] = 0L;
isLoopback = Parse(str, numbers, start, ref scopeId);
return '[' + CreateCanonicalName(numbers) + ((numbers[0] == 0xfe80) ? scopeId : "") + ']';
return '[' + CreateCanonicalName(numbers) + ']';
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,34 +234,6 @@ private void ParseBadIPv4Address(string badIpv4String)

#region IPv6

[Theory]
[InlineData("fe80::e077:c9a3:eeba:b8e9", "%18")]
[InlineData("Fe80::e077:c9a3:eeba:b8e9", "%18")]
[InlineData("fE80::e077:c9a3:eeba:b8e9", "%18")]
[InlineData("FE80::e077:c9a3:eeba:b8e9", "%18")]
[InlineData("FE80::e077:c9a3:eeba:b8e9", "%eth10")]
[InlineData("FE80::e077:c9a3:eeba:b8e9", "")]
[InlineData("FE80::e077:c9a3:eeba:b8e9", "%")]
[InlineData("fe80::e077:c9a3:eeba:b8e9", "%\u30AF\u20E7")]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void Host_IPv6LinkLocalAddress_HasScopeId(string address, string zoneIndex)
{
string scopedLiteralIpv6 = "[" + address + zoneIndex + "]";
string literalIpV6Uri = "http://" + scopedLiteralIpv6;
var uri = new Uri(literalIpV6Uri);
Assert.Equal(scopedLiteralIpv6, uri.Host, ignoreCase: true);
}

[Theory]
[InlineData("fe81::e077:c9a3:eeba:b8e9", "%18")]
public void Host_NonIPv6LinkLocalAddress_NoScopeId(string address, string zoneIndex)
{
string scopedLiteralIpv6 = "[" + address + zoneIndex + "]";
string literalIpV6Uri = "http://" + scopedLiteralIpv6;
var uri = new Uri(literalIpV6Uri);
Assert.Equal("[" + address + "]", uri.Host);
}

[Fact]
public void UriIPv6Host_CanonicalCollonHex_Success()
{
Expand Down

0 comments on commit 5623812

Please sign in to comment.