Results 1 to 3 of 3

Thread: UriUtils does double encode

Threaded View

  1. #1
    Join Date
    Nov 2007
    Posts
    10

    Default UriUtils does double encode

    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 following
    Code:
    API=http://server/path?key=...&url={url}
    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)
    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.

    Wondering why that happens...

    Thanks in advance for clarification!
    Last edited by Eduard Dudar; Jul 3rd, 2011 at 04:24 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •