return FilterMatchDecision.abort_not_found; // block this request
@@ -180,6 +183,7 @@ public class BubbleBlockRuleDriver extends TrafficAnalyticsRuleDriver {
if (refererDecision != null) return refererDecision;
}
if (log.isInfoEnabled()) log.info(prefix+"decision is ALLOW");
else if (extraLog) log.error(prefix+"decision is ALLOW");
return FilterMatchDecision.no_match;
case filter:
@@ -189,20 +193,24 @@ public class BubbleBlockRuleDriver extends TrafficAnalyticsRuleDriver {
}
final List<BlockSpec> specs = decision.getSpecs();
if (empty(specs)) {
log.warn(prefix+"decision was 'filter' but no specs were found, returning no_match");
if (log.isWarnEnabled()) log.warn(prefix+"decision was 'filter' but no specs were found, returning no_match");
else if (extraLog) log.error(prefix+"decision was 'filter' but no specs were found, returning no_match");
return FilterMatchDecision.no_match;
} else {
if (!bubbleBlockConfig.inPageBlocks()) {
for (BlockSpec spec : specs) {
if (spec.hasNoSelector()) {
log.info(prefix+"decision was FILTER but a URL block was triggered and inPageBlocks are disabled (returning abort_not_found)");
if (log.isInfoEnabled()) log.info(prefix+"decision was FILTER but a URL block was triggered and inPageBlocks are disabled (returning abort_not_found)");
else if (extraLog) log.error(prefix+"decision was FILTER but a URL block was triggered and inPageBlocks are disabled (returning abort_not_found)");
return FilterMatchDecision.abort_not_found;
}
}
log.info(prefix+"decision was FILTER but no URL-blocks and inPageBlocks are disabled (returning no_match)");
if (log.isInfoEnabled()) log.info(prefix+"decision was FILTER but no URL-blocks and inPageBlocks are disabled (returning no_match)");
else if (extraLog) log.error(prefix+"decision was FILTER but no URL-blocks and inPageBlocks are disabled (returning no_match)");
return FilterMatchDecision.no_match;
}
if (log.isInfoEnabled()) log.info(prefix+"decision is FILTER (returning match)");
else if (extraLog) log.error(prefix+"decision is FILTER (returning match)");
return FilterMatchDecision.match;
}
}
@@ -221,7 +229,7 @@ public class BubbleBlockRuleDriver extends TrafficAnalyticsRuleDriver {
final String refererPath = refererURI.getPath();
final String userAgent = filter.getUserAgent();
if (log.isInfoEnabled()) log.info(prefix+"decision for URL was ALLOW, checking against referer: host="+refererURI.getHost()+", path="+refererURI.getPath());
final BlockDecision refererDecision = getDecision(refererHost, refererPath, userAgent);
final BlockDecision refererDecision = getPreprocessDecision(refererHost, refererPath, userAgent, refererHost);
switch (refererDecision.getDecisionType()) {
case block:
if (log.isInfoEnabled()) log.info(prefix+"decision for URL was ALLOW but for referer is BLOCK");
@@ -236,18 +244,28 @@ public class BubbleBlockRuleDriver extends TrafficAnalyticsRuleDriver {