Skip to content

AntPathMatcher.AntPatternComparator algorithm wrong for hierarchical matches [SPR-8683] #13325

@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-8683 and commented

AntPathMatcher.AntPatternComparator algorithm wrong for hierarchical matches, Consider an incoming request

GET /hotels/foo/rooms

and two patterns that match

1: /hotels/{hotel}/**
2: /**

Intuitively 1 is more specific than 2, so the comparator should return negative with compare(1,2) (i.e. 1<2). Unfortunately this is not the case because the comparator thinks that 2 is more specific because it has fewer matching points (wildcards + brackets).


Affects: 3.0.6

Issue Links:

Referenced from: commits spring-attic/spring-framework-issues@876f756, spring-attic/spring-framework-issues@4332c1b

6 votes, 10 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions