#1727 - Prevent premature base encoding in UriTemplate if host is templated.

This commit is contained in:
Oliver Drotbohm
2021-12-10 10:50:05 +01:00
parent 809b5ca770
commit 004c46be3b
2 changed files with 15 additions and 4 deletions

View File

@@ -375,6 +375,13 @@ class UriTemplateUnitTest {
assertThat(template.toString()).isEqualTo("/path/{bar}/foo.zip?type=foo{&foobar}");
}
@Test // #1727
void supportsVariableInHostName() {
assertThatCode(() -> UriTemplate.of("https://{somehost}/somepath"))
.doesNotThrowAnyException();
}
private static void assertVariables(UriTemplate template, TemplateVariable... variables) {
assertVariables(template, Arrays.asList(variables));
}