Re: Default “deny”

Splash Forums Rewrite Users Default "deny" Re: Default “deny”

#22793

I got it.

The problem was that the fallback rule was evaluated before the joins where executed. I don’t understand why this happens, but adding a priority to the fallback rule which is higher than the default priority of your configuration provider fixes the problem:

public class TestHttpConfigurationProvider extends HttpConfigurationProvider
{

@Override
public Configuration getConfiguration(ServletContext context)
{
return ConfigurationBuilder
.begin()
.addRule(Join.path("/index").to("/index.html"))
.addRule(Join.path("/test").to("/test.html"))
.defineRule()
.withPriority(20)
.when(Direction.isInbound().and(DispatchType.isRequest()))
.perform(Response.setCode(403).and(Lifecycle.abort()))
;

}

@Override
public int priority()
{
return 10;
}
}

Please also not the Lifecycle.abort() that I had to add so that the lifecycle is correctly aborted here.