-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Closed
Copy link
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement
Description
Jean-Louis Jouannic opened SPR-10959 and commented
Expanding an instance of UriComponents with variable on the path gives different results, depending if it was built from a full String template, or if path segments were appended later.
Here is an example taken from the last comments of issue SPR-8662:
String uri = "http://foo/{bar}";
UriComponents uriComponents = UriComponentsBuilder.fromUriString(uri).build();
System.out.println(uriComponents.expand("user/name").encode().toUriString());
produces
http://foo/user/name
whereas
String uri = "http://foo";
UriComponents uriComponents = UriComponentsBuilder.fromUriString(uri).pathSegment("{bar}").build();
System.out.println(uriComponents.expand("user/name").encode().toUriString());
produces
http://foo/user%2Fname
Affects: 3.2.4
Issue Links:
- Provide option in RestTemplate to encode slash in URI variables [SPR-12750] #17347 Provide option in RestTemplate to encode slash in URI variables
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement