SPR-5924 - REOPENED -PathVariable mappings are greedy over hard coded mappings
This commit is contained in:
@@ -409,7 +409,7 @@ public class AntPathMatcher implements PathMatcher {
|
||||
if (bracketCount1 < bracketCount2) {
|
||||
return -1;
|
||||
}
|
||||
else if (bracketCount1 < bracketCount2) {
|
||||
else if (bracketCount2 < bracketCount1) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -388,6 +388,7 @@ public class AntPathMatcherTests {
|
||||
assertEquals(1, comparator.compare("/hotels/{hotel}", "/hotels/new"));
|
||||
assertEquals(0, comparator.compare("/hotels/{hotel}", "/hotels/{hotel}"));
|
||||
assertEquals(-1, comparator.compare("/hotels/{hotel}/booking", "/hotels/{hotel}/bookings/{booking}"));
|
||||
assertEquals(1, comparator.compare("/hotels/{hotel}/bookings/{booking}", "/hotels/{hotel}/booking"));
|
||||
|
||||
assertEquals(-1, comparator.compare("/hotels/{hotel}", "/hotels/*"));
|
||||
assertEquals(1, comparator.compare("/hotels/*", "/hotels/{hotel}"));
|
||||
|
||||
Reference in New Issue
Block a user