Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9588

Query parameters are not URL-decoded in rest dsl

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 2.16.2
    • Fix Version/s: None
    • Component/s: rest
    • Labels:
      None
    • Environment:

      Karaf 3.0.4, Java 1.8.0_66, Mac OS X 10.10.5, camel-netty-http4

    • Estimated Complexity:
      Unknown

      Description

      Pretty much what it says in the subject, but here's some sample code:

      rest("/").get("search")
        .param()
          .name("q")
          .type(RestParamType.query)
        .endParam()
        .route()
          .to("direct:search")
        .endRest();
      
      from("direct:search").log("q = ${headers.q}");
      

      Then I do GET /search?q=New%20York and it prints out "q = New%20York" instead of "q = New York". When I use CXF, though, the query parameters are automatically decoded.

      This bug report may also apply to path params and such, but I came across this issue while porting from CXF stubs to the rest dsl.

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              mattsicker Matt Sicker
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: