#1127 - Avoid double encoding in UriTemplate.
We now directly use UriComponentsBuilder in UriTemplate.expand(…) to avoid potential double encoding in the base URI.
This commit is contained in:
@@ -342,6 +342,13 @@ class UriTemplateUnitTest {
|
||||
assertThat(expandedTemplate).isEqualTo("/foo?bar=barExpanded&foobar=singleValue");
|
||||
}
|
||||
|
||||
@Test // #1127
|
||||
void escapesBaseUriProperly() {
|
||||
|
||||
assertThat(UriTemplate.of("https://example.org/foo and bar/{baz}").expand("xyzzy"))
|
||||
.hasToString("https://example.org/foo%20and%20bar/xyzzy");
|
||||
}
|
||||
|
||||
private static void assertVariables(UriTemplate template, TemplateVariable... variables) {
|
||||
assertVariables(template, Arrays.asList(variables));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user