Skip to content

AntPathPatternMatcher hardcoded "/" separator in variables glob #26264

Closed as not planned
@jonenst

Description

@jonenst

If you don't use the default separator, "/" should not be special:

jshell> new AntPathMatcher("\0").extractUriTemplateVariables("tot{;}", "totoa");
$11 ==> {;=oa}
jshell> new AntPathMatcher("\0").extractUriTemplateVariables("tot{/}", "totoa");
|  Exception java.lang.IllegalStateException: Pattern "tot{/}" is not a match for "totoa"
|        at AntPathMatcher.extractUriTemplateVariables (AntPathMatcher.java:516)
|        at (#12:1)

Expected {/=oa}

note: the previous example is treated as an exact match:

jshell> new AntPathMatcher("\0").extractUriTemplateVariables("tot{/}", "tot{/}");
$19 ==> {}

See

private static final Pattern GLOB_PATTERN = Pattern.compile("\\?|\\*|\\{((?:\\{[^/]+?}|[^/{}]|\\\\[{}])+?)}");
there are slashes hardcoded in there

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: supersededAn issue that has been superseded by anothertype: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions