Replace NAMES_PATTERN in UriTemplate
The URI template is now manually parsed vs using a regex to extract URI variable names and to create a pattern for matching to actual URLs. This provides more control to deal with nested curly braces. Issue: SPR-13627
This commit is contained in:
@@ -143,6 +143,15 @@ public class UriTemplateTests {
|
||||
assertEquals("Invalid match", expected, result);
|
||||
}
|
||||
|
||||
// SPR-13627
|
||||
|
||||
@Test
|
||||
public void matchCustomRegexWithNestedCurlyBraces() throws Exception {
|
||||
UriTemplate template = new UriTemplate("/site.{domain:co.[a-z]{2}}");
|
||||
Map<String, String> result = template.match("/site.co.eu");
|
||||
assertEquals("Invalid match", Collections.singletonMap("domain", "co.eu"), result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void matchDuplicate() throws Exception {
|
||||
UriTemplate template = new UriTemplate("/order/{c}/{c}/{c}");
|
||||
|
||||
Reference in New Issue
Block a user