Skip to content

UriUtils does double encode [SPR-8507] #13153

@spring-projects-issues

Description

@spring-projects-issues

Eduard Dudar opened SPR-8507 and commented

I'm seeing quite strange behavior and I'm not sure why UriUtils works this way.

In detail I'm having URL that I want to ask using RestTemplate. Url is the following [CODE]API=http://server/path?key=...&url={url}[/CODE] where {url} is variable that is passed from the outside. Url that is passed in can be any valid URL with query string or not. Then I call [CODE]this.rest.getForObject(API, String.class, url)[/CODE] that call API mentioned above and passed incoming URL into.

And here is what I see. When I pass unencoded url into REST call UriUtils does nothing so I get more parameters then I need because own url parameters are just appended to API parameters. When I do manual encoding first I get double encoded parameter that is also invalid.

I found the code and it definitely works that way, but I'm not sure why already encoded parameters are forced to be double encoded.


Affects: 3.0.5

Reference URL: http://forum.springsource.org/showthread.php?111473-UriUtils-does-double-encode

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently apply

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions