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

Rest endpoint path doesn't respect escaped characters (eg. "plus" sign)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 3.18.3
    • None
    • camel-http, rest
    • None
    • Unknown

    Description

      Having 

      exchange.getIn().getHeaders().put("expression", URLEncoder.encode("4+15", StandardCharsets.UTF_8));
      
      .to("rest:get:simplify/{expression}?host=https://newton.vercel.app/api/v2/")
      

      will produce request with "expression=4 15" (missing plus sign). I've read about using RAW function, but not sure how to use it with path in rest call.

      Reproducer:

      mvn package -DskipTests && mvn camel:run
      

      and it prints

      {"operation":"simplify","expression":"4 15","result":"60"}
      

      instead of

      {"operation":"simplify","expression":"4+15","result":"19"}
      

       

      Attachments

        1. camel-rest-encode.zip
          54 kB
          Lukas Lowinger

        Activity

          People

            Unassigned Unassigned
            llowinge Lukas Lowinger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: