From 5c04f6b50b17185efd9fc5ceb13bc95be438f31d Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Sat, 19 Sep 2020 05:52:06 -0400 Subject: [PATCH] ensure whitelist domains are not included with reject/block domains --- .../java/bubble/service/stream/StandardAppPrimerService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bubble-server/src/main/java/bubble/service/stream/StandardAppPrimerService.java b/bubble-server/src/main/java/bubble/service/stream/StandardAppPrimerService.java index 85a52a3b..89439164 100644 --- a/bubble-server/src/main/java/bubble/service/stream/StandardAppPrimerService.java +++ b/bubble-server/src/main/java/bubble/service/stream/StandardAppPrimerService.java @@ -17,6 +17,7 @@ import bubble.service.device.DeviceService; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.cobbzilla.util.collection.SingletonList; +import org.cobbzilla.util.string.StringUtil; import org.cobbzilla.wizard.cache.redis.RedisService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -189,9 +190,11 @@ public class StandardAppPrimerService implements AppPrimerService { if (!empty(rejectDomains) || !empty(blockDomains) || !empty(filterDomains) || !empty(flexDomains) || !empty(flexExcludeDomains)) { for (String ip : accountDeviceIps.get(device.getUuid())) { if (!empty(rejectDomains)) { + rejectDomains.removeAll(whiteListDomains); AppRuleDriver.defineRedisRejectSet(redis, ip, app.getName() + ":" + app.getUuid(), rejectDomains.toArray(String[]::new)); } if (!empty(blockDomains)) { + blockDomains.removeAll(whiteListDomains); AppRuleDriver.defineRedisBlockSet(redis, ip, app.getName() + ":" + app.getUuid(), blockDomains.toArray(String[]::new)); } if (!empty(whiteListDomains)) {