Reply To: Cannot forward after response has been committed

Splash Forums Rewrite Users Cannot forward after response has been committed Reply To: Cannot forward after response has been committed

#27005

I see another problem with your rule. Currently it will match on ALL urls, and “excluded” will always be empty. The reason is this:

.where("excluded").matches("(?!/wres|/123/123/test)")

The problem here is that the above regex is always going to be 0-width, (because the lookahead is zero width, and the regular expression has no character groups.) It should probably be:

.where("excluded").matches("(?!/wres|/123/123/test).*")

But this leads to another problem, where I think that will cause “excluded” to match more than what you want. In reality, I think you are trying to improperly use two parameters to match one thing. That won’t work. You should just do this all with the parameter for “url”.

ConfigurationBuilder config = ConfigurationBuilder.begin();

config.addRule()
         .when(Direction.isInbound().and(Path.matches("{url}"))
            .andNot(DispatchType.isError())
         )
         .perform(Forward.to("/123/123/test?url={url}" ) )
         .where("url").matches("(?!/wres|/123/123/test).*");

I am about to try this myself.