Claus Ibsen created CAMEL-25190:
-----------------------------------
Summary: Camel 5 - URISupport.normalizeUri turns an encoded plus
(%2B) in a query value into a space
Key: CAMEL-25190
URL: https://issues.apache.org/jira/browse/CAMEL-25190
Project: Camel
Issue Type: Improvement
Components: camel-core
Reporter: Claus Ibsen
In an endpoint URI, Camel follows the web form convention
(application/x-www-form-urlencoded) that + in a query value is a space. Under
that same convention %2B is how a literal plus is written. But normalizing a
URI decodes %2B to +, which is then read as a space, so the endpoint never gets
the plus:
||URI||the endpoint gets||
|log:foo?marker=a%2Bb|a b|
|ftp://host/dir?password=se%2Bcret|se cret|
|log:foo?marker=RAW(a+b)|a+b|
This is the same in every release since at least 4.10 (checked 4.10.9, 4.14.8,
4.18.3, 4.22.1). The workaround is RAW(...), which the docs already recommend
for passwords and tokens.
Fixing it changes the values for anyone who relies on the current behaviour, so
it is left for Camel 5: keep %2B encoded when normalizing, so it reaches the
endpoint as a literal plus, and add an upgrade guide note.
Found while fixing CAMEL-25188 (+ vs %20 for a space in the fast path).
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)