From 192001bbd4070fe3a45703cd55847a479bb16081 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Mon, 26 Apr 2021 01:59:31 +0200 Subject: [PATCH] Fixed anonymize map call. --- src/fr/devinsy/logar/app/anonymizer/Anonymizer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fr/devinsy/logar/app/anonymizer/Anonymizer.java b/src/fr/devinsy/logar/app/anonymizer/Anonymizer.java index d085288..76e497d 100644 --- a/src/fr/devinsy/logar/app/anonymizer/Anonymizer.java +++ b/src/fr/devinsy/logar/app/anonymizer/Anonymizer.java @@ -47,8 +47,8 @@ public final class Anonymizer { private static Logger logger = LoggerFactory.getLogger(Anonymizer.class); - public static final Pattern IPV4_PATTERN = Pattern.compile("\\d{0,3}\\.\\d{0,3}\\.\\d{0,3}\\.\\d{0,3}"); - public static final Pattern IPV6_PATTERN = Pattern.compile("([0-9a-f]{1,4}:{1,2}){4,7}([0-9a-f]){1,4}", Pattern.CASE_INSENSITIVE); + public static final Pattern IPV4_PATTERN = Pattern.compile("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"); + public static final Pattern IPV6_PATTERN = Pattern.compile("([0-9a-f]){1,4}(:{1,2}[0-9a-f]{0,4}){4,7}", Pattern.CASE_INSENSITIVE); private AnonMap map; @@ -206,7 +206,7 @@ public final class Anonymizer String ipv4 = matcher.group(); String right = anonLine.substring(matcher.end()); - String anonIpv4 = this.map.get(ipv4); + String anonIpv4 = this.map.anonymizeIp(ipv4); anonLine = left + anonIpv4 + right; } @@ -218,7 +218,7 @@ public final class Anonymizer String ipv6 = matcher.group(); String right = anonLine.substring(matcher.end()); - String anonIpv6 = this.map.get(ipv6); + String anonIpv6 = this.map.anonymizeIp(ipv6); anonLine = left + anonIpv6 + right; }