Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1038

UriBuilder.queryParam with URI as param with query param

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • 3.0.7.Final
    • None
    • None
    • None

      I've been using UriBuilder to build redirect URIs inside a web application.
      Until now, I only builded simple query parameters, but today I wanted to build an URI inside a queryParam.

      The URI to be used as query is builded like:
      > UriBuilder toQuery = UriBuilder.fromPath("/come_again").queryParam("t", "1234");

      The main URI which will hold this one is builded:
      > URI builded = UriBuilder.fromPath("/some").queryParam("next", toQuery.build().toASCIIString()).build();
      I've tryied other ways (with build template arguments too, and using buildFromEncoded) but none of them produced the expected URI.

      Expected should be:
      > /some?next=%2Fcome_again%3Ft%3D1234
      But the result is:
      > /some?next=%2Fcome_again?t%3D1234

      All parameters get encoded, except the question mark.
      I've attach a JUnit test class.

      The main problem (which I found debugging) is with 'org.jboss.resteasy.util.Encode.queryNameValueEncoding', which considers as not encodeable char the question mark. But I think, that it should be encoded inside a query, if I understand correctly an URI format....

      I'm building incorrectly this URI?
      Is a JAX-RS spec problem?
      Should file a RESTEasy bug?

              patriot1burke@gmail.com Bill Burke (Inactive)
              patriot1burke@gmail.com Bill Burke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: