SPR-8858 Fix in AntPathMatcher.combine(..)
Currently the combine method consolidates "/*" and "/hotel"
into "/hotel". However if the first pattern contains URI template
variables, the consolidation seems wrong. The fix is to prevent
the consolidation if the first pattern contains "{".
This commit is contained in:
@@ -148,10 +148,11 @@ public class ServletAnnotationMappingUtilsTests {
|
||||
@Test
|
||||
public void checkHeadersKeyValueNoMatchWithNegation() {
|
||||
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/");
|
||||
request.addHeader("header1", "value1");
|
||||
String[] headers = new String[]{"header1!=value1"};
|
||||
boolean result = ServletAnnotationMappingUtils.checkHeaders(headers, request);
|
||||
assertFalse("Invalid request method result", result);
|
||||
request.addHeader("Accept-Encoding", "gzip");
|
||||
String[] headers1 = new String[]{"Accept-Encoding!=gzip"};
|
||||
String[] headers2 = new String[]{"Accept-Encoding=gzip"};
|
||||
assertFalse(ServletAnnotationMappingUtils.checkHeaders(headers1, request));
|
||||
assertTrue(ServletAnnotationMappingUtils.checkHeaders(headers2, request));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user