Skip to content

Commit

Permalink
Enabled flag respected
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian-panek-vmltech committed Jul 29, 2024
1 parent d6e3b5b commit 05a4f5a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/src/main/java/com/wttech/aem/stubs/core/StubFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class StubFilter implements Filter {
public @interface Config {

@AttributeDefinition(name = "Enabled")
boolean enabled();
boolean enabled() default true;

@AttributeDefinition(name = "Whiteboard Filter Regex")
String[] osgi_http_whiteboard_filter_regex();
Expand All @@ -59,7 +59,13 @@ protected void activate(Config config) {
}

@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException {
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException {
if (!config.enabled()) {
chain.doFilter(req, res);
return;
}

var request = (HttpServletRequest) req;
var response = (HttpServletResponse) res;

Expand Down

0 comments on commit 05a4f5a

Please sign in to comment.