If ip whitelist of app is "1.2.3.6-8,1.2.3.86-88", and "1.2.3.6-8" "1.2.3.86-88" have some subnet "1.2.3", then "1.2.3.6-8" will be lost #255

This commit is contained in:
lancer.hong
2021-07-21 10:43:36 +08:00
parent f45c5e689a
commit 7ded8514ac
2 changed files with 3 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ public class App {
String subnet = ip.substring(0, i).trim();
String addrSeg = ip.substring(i + 1).trim();
if ("*".equals(addrSeg)) {
this.ips.put(subnet, Collections.singletonList(new String[]{"2", "254"}));
this.ips.put(subnet, Collections.singletonList(new String[]{"1", "255"}));
} else if (addrSeg.indexOf('-') > 0) {
String[] a = StringUtils.split(addrSeg, '-');
String beg = a[0].trim();

View File

@@ -22,9 +22,9 @@ public class AppTests {
allow = app.allow("10.237.148.134");
assertTrue(allow);
allow = app.allow("172.25.102.2");
allow = app.allow("172.25.102.1");
assertTrue(allow);
allow = app.allow("172.25.102.254");
allow = app.allow("172.25.102.255");
assertTrue(allow);
allow = app.allow("172.25.102.3");
assertTrue(allow);