Skip to content

Commit 8d21f9b

Browse files
committed
Bug fix
1 parent 398dbbd commit 8d21f9b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

v2rayN/v2rayN/Handler/ShareHandler.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,21 @@ private static string ShareWireguard(ProfileItem item)
264264

265265
private static string GetIpv6(string address)
266266
{
267-
return Utils.IsIpv6(address) ? $"[{address}]" : address;
267+
if (Utils.IsIpv6(address))
268+
{
269+
if (address.StartsWith('[') && address.EndsWith(']'))
270+
{
271+
return address;
272+
}
273+
else
274+
{
275+
return $"[{address}]";
276+
}
277+
}
278+
else
279+
{
280+
return address;
281+
}
268282
}
269283

270284
private static int GetStdTransport(ProfileItem item, string? securityDef, ref Dictionary<string, string> dicQuery)

0 commit comments

Comments
 (0)