davsclaus opened a new pull request, #25084:
URL: https://github.com/apache/camel/pull/25084

   ## Summary
   
   _Claude Code on behalf of davsclaus_
   
   Fixes a regression introduced in 4.14.0 (by CAMEL-22293 / PR #18772) where 
`+` and `%` characters in Endpoint DSL option values are silently mangled 
during the URI encoding/decoding round-trip.
   
   **Root cause**: `AbstractEndpointBuilder.resolve()` was changed to resolve 
endpoints from the URI string alone, removing the safety net where raw 
properties overwrote values parsed from the URI. The `+` character gets 
double-decoded: `URLEncoder` encodes it as `%2B`, `URI.getQuery()` 
percent-decodes it back to literal `+`, then `URLDecoder.decode()` interprets 
that `+` as a space.
   
   **Fix**: `computeProperties()` now automatically wraps string values 
containing `+` or `%` in `RAW()` so the URI parser preserves the value 
verbatim. Values already wrapped in `RAW()` or starting with `#` (registry 
references) are left alone.
   
   This affects any endpoint option value containing `+` or `%` when set via 
the Endpoint DSL, including SFTP `knownHosts` (SSH public keys contain `+`), 
passwords, SQL queries, etc.
   
   - 
[`AbstractEndpointBuilder.java`](dsl/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/AbstractEndpointBuilder.java)
 — added `wrapRawIfNeeded()` helper
   - 
[`FtpSpecialCharParameterTest.java`](dsl/camel-endpointdsl/src/test/java/org/apache/camel/builder/endpoint/FtpSpecialCharParameterTest.java)
 — new test verifying `+` and `%` are preserved without manual `RAW()` wrapping
   
   ## Test plan
   
   - [x] New `FtpSpecialCharParameterTest` verifies `+` and `%` preserved 
without manual `RAW()`
   - [x] Existing `FtpRawParameterTest` still passes (manual `RAW()` wrapping 
still works)
   - [x] Full `camel-endpointdsl` test suite passes (66 tests, 0 failures)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   Co-Authored-By: Claude Opus 4.6 <[email protected]>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to