-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
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:
- UriTemplate doesn't encode query parameters [SPR-8403] #13050 UriTemplate doesn't encode query parameters