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:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user