-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Closed
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issueA duplicate of another issue
Milestone
Description
Johnathon opened SPR-8355 and commented
When sorting the following array: [/a/b/{c}/, /a/b/{c}//, /, //] with the current implementation of AntPathMatcher.AntPatternComparator, the sort order results in: [//, /, /a/b/{c}//, /a/b/{c}/] . In our case, this results in the wrong controller picking up the request.
I believe the problem lies in this block:
if (totalCount1 != totalCount2) {
return totalCount1 - totalCount2;
}
and would be correct if instead it returned "totalCount2 - totalCount1;". However, I can't speak to how this may affect other use cases.
Affects: 3.0.4, 3.0.5
Issue Links:
- Assign lowest priority to "/**" in AntPathMatcher [SPR-10550] #15181 Assign lowest priority to "/" in AntPathMatcher (_"duplicates"**_)
- AntPathMatcher.AntPatternComparator algorithm wrong for hierarchical matches [SPR-8683] #13325 AntPathMatcher.AntPatternComparator algorithm wrong for hierarchical matches
3 votes, 3 watchers
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issueA duplicate of another issue