Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"-" in mod_rewrite config incorrectly parsed #203

Open
display-none opened this issue Aug 29, 2016 · 0 comments
Open

"-" in mod_rewrite config incorrectly parsed #203

display-none opened this issue Aug 29, 2016 · 0 comments

Comments

@display-none
Copy link

When filter is configured with mod_rewrite config and such config features a RewriteRule with a dash ("-") as to part, the rule is incorrectly handled.

ModRewriteConfLoader sets rule.to only when it's not equal to "-":

if (partCounter == 2 && !"-".equals(part)) {
    rule.setTo(part);
}

in effect rule.to is null and in RuleBase:

if (StringUtils.isBlank(to) && setAttributes.size() == 0 && runs.size() == 0) {
    addError("to is not valid because it is blank (it is allowed to be blank when there is a 'set' specified)");
} else if ("null".equalsIgnoreCase(to)) {
    stopFilterChainOnMatch = true;
} else if ("-".equals(to)) {
    noSubstitution = true;
}

the first if is executed, not the third.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant