Compare suffix patterns by length

Closes gh-23125
This commit is contained in:
Rossen Stoyanchev
2019-07-05 07:36:35 +01:00
parent 157df861f9
commit 0d3e5db3ff
2 changed files with 7 additions and 3 deletions

View File

@@ -776,7 +776,10 @@ public class AntPathMatcher implements PathMatcher {
return 1;
}
if (info1.isPrefixPattern() && info2.getDoubleWildcards() == 0) {
if (info1.isPrefixPattern() && info2.isPrefixPattern()) {
return info2.getLength() - info1.getLength();
}
else if (info1.isPrefixPattern() && info2.getDoubleWildcards() == 0) {
return 1;
}
else if (info2.isPrefixPattern() && info1.getDoubleWildcards() == 0) {