Claus Ibsen created CAMEL-27361:
-----------------------------------

             Summary: camel-core - an optional property placeholder {{?x}} in 
an endpoint path makes EndpointUriFactorySupport add the query with & instead 
of ?
                 Key: CAMEL-27361
                 URL: https://issues.apache.org/jira/browse/CAMEL-27361
             Project: Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Claus Ibsen
             Fix For: 4.24.0


{{EndpointUriFactorySupport.buildQueryParameters}} decides between {{?}} and 
{{&}} with {{uri.indexOf('?') != -1}} (the code comments say "there may be a ? 
sign in the context path then use & instead"). An optional placeholder such as 
{{{{?directoryName}}}} in a path parameter contains a {{?}}, so the query is 
appended with {{&}}:

{noformat}
smb:host:445/share/{{?directoryName}}&antInclude=...&password=RAW(...)
{noformat}

The query options are then part of the path, so all of them are lost. In the 
case seen, the password was dropped and the route failed with a 
NullPointerException in camel-smb.

Expected: a {{?}} that belongs to a property placeholder ({{{{?...}}}}) does 
not count as the start of the query, or the query separator is decided from the 
parsed path parameters rather than from the text.

Found while adding new Kamelets to the Kamelet catalog (apache/camel-kamelets, 
2026-11-21).



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to