Strip IPV6: prefix from bracket addresses

This commit is contained in:
M66B 2022-01-09 08:53:25 +01:00
parent 03e8fb8555
commit ef8eea1d4e
1 changed files with 2 additions and 0 deletions

View File

@ -2215,6 +2215,8 @@ public class MessageHelper {
int e = value.indexOf(']', s + 1);
if (s >= 0 && e > 0) {
String ip = value.substring(s + 1, e);
if (ip.toLowerCase(Locale.ROOT).startsWith("ipv6:"))
ip = ip.substring(5);
if (ConnectionHelper.isNumericAddress(ip) &&
ConnectionHelper.isLocalAddress(ip))
return true;