Fragment should be expanded last

Closes gh-22447
This commit is contained in:
Rossen Stoyanchev
2019-03-12 15:05:35 -04:00
parent 7dc522f0d6
commit 2b4cd5cf56
2 changed files with 12 additions and 1 deletions

View File

@@ -130,6 +130,15 @@ public class UriComponentsTests {
UriComponentsBuilder.fromUriString("/myurl/?q={{{{").encode().build().toUriString());
}
@Test // gh-22447
public void expandWithFragmentOrder() {
UriComponents uriComponents = UriComponentsBuilder
.fromUriString("http://{host}/{path}#{fragment}").build()
.expand("example.com", "foo", "bar");
assertEquals("http://example.com/foo#bar", uriComponents.toUriString());
}
@Test // SPR-12123
public void port() {
UriComponents uri1 = fromUriString("http://example.com:8080/bar").build();