1. Camel
  2. CAMEL-4954

Camel 2.9.0 incapable of working with % in endpoint URIs


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.9.0
    • Fix Version/s: 2.9.1, 2.10.0
    • Component/s: camel-core
    • Labels:
    • Environment:

      Mac 10.7 Java 1.6.0_29

    • Estimated Complexity:


      In the class org.apache.camel.util.URISupport which will be used to resolve endpoints (DefaultCamelContext#normalizeEndpointUri) the method parseParameters will be called.
      At first the will be called with according to the javadoc "Returns the decoded query component of this URI" returns a decoded URI. If that fails the method will be called which according to the javadoc "Returns the decoded scheme-specific part of this URI." returns a decoded URI.
      So to summarize we get in any case a decoded URI.
      This URI will then be than in the method org.apache.camel.util.URISupport#parseQuery(String) again decoded with,String).
      This code leads to the following behaviour:
      If a % is properly encoded with %25test the %25test will be substituted by the first call to %test and the decoded again which leads to an Exception.

      In the commit you can see that the % was uncommented from org.apache.camel.util#UnsafeUriCharactersEncoder. Maybe this is related.

      However... Double encoding of URIs seems quite odd. With any URI char there is no issue with that. But with % the % will be decoded again, which makes a % unusable in Camel.

        0.7 kB
        Sebastian Rühl

        Issue Links


          Sebastian Rühl created issue -
          Sebastian Rühl made changes -
          Field Original Value New Value
          Link This issue is related to CAMEL-4425 [ CAMEL-4425 ]
          Sebastian Rühl made changes -
          Environment Mac 10.7 Java6 Mac 10.7 Java 1.6.0_29
          Sebastian Rühl made changes -
          Attachment [ 12512949 ]
          Hadrian Zbarcea made changes -
          Assignee Hadrian Zbarcea [ hadrian ]
          Hadrian Zbarcea made changes -
          Fix Version/s 2.9.1 [ 12319191 ]
          Fix Version/s 2.10.0 [ 12317612 ]
          Hadrian Zbarcea made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Daniel Goering made changes -
          Link This issue is a clone of CAMEL-6176 [ CAMEL-6176 ]


            • Assignee:
              Hadrian Zbarcea
              Sebastian Rühl
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: