Skip to content

Commit 1b60983

Browse files
committed
[Modify] Add it
1 parent ecd9e68 commit 1b60983

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

websocket-sharp/Ext.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,13 @@ internal static string GetAbsolutePath (this Uri uri)
405405
return idx > 0 ? original.Substring (0, idx) : original;
406406
}
407407

408+
internal static string GetDnsSafeHost (this Uri uri, bool bracketIPv6)
409+
{
410+
return bracketIPv6 && uri.HostNameType == UriHostNameType.IPv6
411+
? uri.Host
412+
: uri.DnsSafeHost;
413+
}
414+
408415
internal static string GetMessage (this CloseStatusCode code)
409416
{
410417
return code == CloseStatusCode.ProtocolError

0 commit comments

Comments
 (0)