Correction for commit #b219c6c
Issue: SPR-17630
This commit is contained in:
@@ -458,7 +458,7 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable {
|
||||
*/
|
||||
public String toUriString() {
|
||||
return this.uriVariables.isEmpty() ?
|
||||
encode().build().toUriString() :
|
||||
build().encode().toUriString() :
|
||||
buildInternal(EncodingHint.ENCODE_TEMPLATE).toUriString();
|
||||
}
|
||||
|
||||
|
||||
@@ -934,4 +934,9 @@ public class UriComponentsBuilderTests {
|
||||
assertEquals("http://localhost:8081/{path}?sort={sort}&sort=another_value", uri);
|
||||
}
|
||||
|
||||
@Test // SPR-17630
|
||||
public void toUriStringWithCurlyBraces() {
|
||||
assertEquals("/path?q=%7Basa%7Dasa",
|
||||
UriComponentsBuilder.fromUriString("/path?q={asa}asa").toUriString());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user