Revise URI template handling in WhatWgUrlParser

Closes gh-33673
This commit is contained in:
rstoyanchev
2024-10-09 12:52:56 +01:00
parent 1f4743af54
commit f4967f202e
3 changed files with 44 additions and 67 deletions

View File

@@ -603,6 +603,18 @@ class UriComponentsBuilderTests {
assertThat(result.toUriString()).isEqualTo("/fooValue/barValue");
}
@ParameterizedTest
@EnumSource(value = ParserType.class)
void parseBuildAndExpandHierarchical(ParserType parserType) {
URI uri = UriComponentsBuilder
.fromUriString("{scheme}://{host}:{port}/{segment}?{query}#{fragment}", parserType)
.buildAndExpand(Map.of(
"scheme", "ws", "host", "example.org", "port", "7777", "segment", "path",
"query", "q=1", "fragment", "foo"))
.toUri();
assertThat(uri.toString()).isEqualTo("ws://example.org:7777/path?q=1#foo");
}
@ParameterizedTest
@EnumSource(value = ParserType.class)
void buildAndExpandOpaque(ParserType parserType) {