Hello guys!
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 followingwhere {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 callCode:API=http://server/path?key=...&url={url}that call API mentioned above and passed incoming URL into.Code:this.rest.getForObject(API, String.class, url)
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.
Wondering why that happens...
Thanks in advance for clarification!


Reply With Quote