Browse Source

check parent domains for flex routing

pull/51/head
Jonathan Cobb 4 years ago
parent
commit
ee3ff48895
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      bubble-server/src/main/java/bubble/rule/AppRuleDriver.java

+ 8
- 3
bubble-server/src/main/java/bubble/rule/AppRuleDriver.java View File

@@ -81,9 +81,14 @@ public interface AppRuleDriver {

static boolean isFlexRouteFqdn(RedisService redis, String ip, String fqdn) {
final String key = REDIS_FLEX_LISTS + "~" + ip + REDIS_LIST_SUFFIX;
final boolean found = redis.sismember_plaintext(key, fqdn);
if (log.isErrorEnabled()) log.error("isFlexRouteFqdn("+ip+", "+fqdn+") == "+found+ "(key="+key+")");
return found;
String check = fqdn;
while (true) {
final boolean found = redis.sismember_plaintext(key, check);
if (found) return true;
final int dotPos = check.indexOf('.');
check = check.substring(dotPos+1);
if (!check.contains(".")) return false;
}
}

AppRuleDriver getNext();


Loading…
Cancel
Save