private static ErrorResponse createDefaultResponse(RuleBasedFilterConfig.DefaultRule defaultRule) {
        switch (defaultRule.action()) {
            case ALLOW: return null;
            case BLOCK: {
                Response response = new Response(defaultRule.blockResponseCode());
                defaultRule.blockResponseHeaders().forEach(h -> response.headers().add(h.name(), h.value()));
                return new ErrorResponse(response, defaultRule.blockResponseMessage());
            }
            default: throw new IllegalArgumentException(defaultRule.action().name());
        }
    }
Security request filter that filters requests based on host, method and uri path.

@author bjorncs
jdisc-security-filters/src/main/java/com/yahoo/jdisc/http/filter/security/rule/RuleBasedRequestFilter.java