Parcourir la source

check parent domains for flex routing

pull/51/head
Jonathan Cobb il y a 4 ans
Parent
révision
ee3ff48895
1 fichiers modifiés avec 8 ajouts et 3 suppressions
  1. +8
    -3
      bubble-server/src/main/java/bubble/rule/AppRuleDriver.java

+ 8
- 3
bubble-server/src/main/java/bubble/rule/AppRuleDriver.java Voir le fichier

@@ -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();


Chargement…
Annuler
Enregistrer