Fix ip validation problem in app
This commit is contained in:
@@ -84,16 +84,14 @@ 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[]{"1", "255"}));
|
||||
// this.ips.put(subnet, Collections.singletonList(new String[]{"1", "255"}));
|
||||
List<String[]> segs = this.ips.computeIfAbsent(subnet, k -> new ArrayList<>());
|
||||
segs.add(new String[]{"1", "255"});
|
||||
} else if (addrSeg.indexOf('-') > 0) {
|
||||
String[] a = StringUtils.split(addrSeg, '-');
|
||||
String beg = a[0].trim();
|
||||
String end = a[1].trim();
|
||||
List<String[]> lst = this.ips.get(subnet);
|
||||
if (lst == null) {
|
||||
lst = new ArrayList<>();
|
||||
this.ips.put(subnet, lst);
|
||||
}
|
||||
List<String[]> lst = this.ips.computeIfAbsent(subnet, k -> new ArrayList<>());
|
||||
lst.add(new String[]{beg, end});
|
||||
} else {
|
||||
this.ips.put(ip, null);
|
||||
|
||||
@@ -90,9 +90,10 @@ public class AppService {
|
||||
updateAppMap(app, appMapTmp);
|
||||
return Flux.just(e);
|
||||
} catch (Throwable t) {
|
||||
throwable[0] = t;
|
||||
log.info(json, t);
|
||||
return Flux.error(t);
|
||||
// throwable[0] = t;
|
||||
log.warn(json, t);
|
||||
// return Flux.error(t);
|
||||
return Flux.just(e);
|
||||
}
|
||||
}).blockLast())).flatMap(
|
||||
e -> {
|
||||
@@ -107,7 +108,8 @@ public class AppService {
|
||||
}
|
||||
).block();
|
||||
if (error != ReactorUtils.EMPTY_THROWABLE) {
|
||||
throw error;
|
||||
// throw error;
|
||||
log.error(Consts.S.EMPTY, error);
|
||||
}
|
||||
|
||||
appMap = appMapTmp;
|
||||
|
||||
Reference in New Issue
Block a user