Skip to content

RedirectManager: Always quote the context prefix if used in a regular expression #3663

@kwin

Description

@kwin

Currently the context prefix is used as is in the redirect manager (

rulePattern = RedirectRule.toRegex(contextPrefix + rulePattern.toString(), nc);
). This does not work well if the context prefix contains characters which require quoting in regular expressions (like .). So the context prefix should always be treated as literal and therefore be prefixed to the pattern with https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#quote-java.lang.String-

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions