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

AntPathPatternMatcher hardcoded "/" separator in variables glob #26264

Closed
jonenst opened this issue Dec 14, 2020 · 2 comments
Closed

AntPathPatternMatcher hardcoded "/" separator in variables glob #26264

jonenst opened this issue Dec 14, 2020 · 2 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: superseded An issue that has been superseded by another type: bug A general bug

Comments

@jonenst
Copy link

jonenst commented Dec 14, 2020

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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 14, 2020
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) in: core Issues in core modules (aop, beans, core, context, expression) labels Nov 10, 2021
@bclozel bclozel added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on in: web Issues in web modules (web, webmvc, webflux, websocket) labels Oct 27, 2023
@bclozel bclozel added this to the 6.2.x milestone Oct 27, 2023
@tafjwr
Copy link
Contributor

tafjwr commented Jun 22, 2024

I worked on this issue in #33085

@bclozel
Copy link
Member

bclozel commented Jun 22, 2024

Closing in favor of #33085

@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale Jun 22, 2024
@bclozel bclozel added the status: superseded An issue that has been superseded by another label Jun 22, 2024
@jhoeller jhoeller removed this from the 6.2.x milestone Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: superseded An issue that has been superseded by another type: bug A general bug
Projects
None yet
Development

No branches or pull requests

6 participants