Skip to content
This repository was archived by the owner on Feb 16, 2019. It is now read-only.

Commit 48b6ddf

Browse files
committed
Handle IPv6 DNS entries Resolves kurrent-io/KurrentDB#1598
1 parent 0ad9c90 commit 48b6ddf

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎src/EventStore.ClientAPI.NetCore/Transport.Http/EndpointExtensions.cs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static string ToHttpUrl(this EndPoint endPoint, string schema, string raw
1111
if (endPoint is IPEndPoint)
1212
{
1313
var ipEndPoint = endPoint as IPEndPoint;
14-
return CreateHttpUrl(schema, ipEndPoint.Address.ToString(), ipEndPoint.Port, rawUrl != null ? rawUrl.TrimStart('/') : string.Empty);
14+
return CreateHttpUrl(schema, ipEndPoint.ToString(), rawUrl != null ? rawUrl.TrimStart('/') : string.Empty);
1515
}
1616
if (endPoint is DnsEndPoint)
1717
{
@@ -26,7 +26,7 @@ public static string ToHttpUrl(this EndPoint endPoint, string schema, string for
2626
if (endPoint is IPEndPoint)
2727
{
2828
var ipEndPoint = endPoint as IPEndPoint;
29-
return CreateHttpUrl(schema, ipEndPoint.Address.ToString(), ipEndPoint.Port, string.Format(formatString.TrimStart('/'), args));
29+
return CreateHttpUrl(schema, ipEndPoint.ToString(), string.Format(formatString.TrimStart('/'), args));
3030
}
3131
if (endPoint is DnsEndPoint)
3232
{
@@ -40,5 +40,10 @@ private static string CreateHttpUrl(string schema, string host, int port, string
4040
{
4141
return $"{schema}://{host}:{port}/{path}";
4242
}
43+
44+
private static string CreateHttpUrl(string schema, string address, string path)
45+
{
46+
return $"{schema}://{address}/{path}";
47+
}
4348
}
4449
}

0 commit comments

Comments
 (0)