davsclaus opened a new pull request, #27026:
URL: https://github.com/apache/camel/pull/27026
## Summary
`DefaultComponent.validateURI` rejected any endpoint uri containing `&&`
unless some `RAW(...)` in the uri contained `&&`. The check is from 2008, when
the query was split with a regexp on `&`. Today the query is parsed by
`URIScanner`, and the check no longer does its job:
- `timer://foo?delay=250&&period=500` never reaches the check with `&&`:
normalization first turns it into `?=&delay=250&period=500`, and the endpoint
fails with `Error binding property (=) with name: ... Index 0 out of bounds`.
- `language:simple:${header.a} == 1 && ${header.b} == 2` (a `&&` in the
path) is rejected with `Invalid uri syntax: Double && marker found`.
Changes:
- `URIScanner` skips an empty parameter (nothing between two `&`), so
`a=1&&b=2` parses as `a=1&b=2`. A segment with a value but no name (`&=x`) is
kept as before, so it still fails.
- `DefaultComponent.validateURI` no longer checks for `&&`, and the
`RAW_PATTERN` workaround (CAMEL-7057) is removed. The trailing `&` check stays.
- Upgrade guide note (4.23).
JIRA: https://issues.apache.org/jira/browse/CAMEL-25120
## Test plan
- [x] `URISupportTest.testParseQueryDoubleAmpersand`: `&&`, leading/triple
`&`, `RAW(se&&cret)`, normalizeUri
- [x] `DefaultComponentValidateURITest`: `testDoubleAmpersand` now resolves
with delay/period set; new `testDoubleAmpersandInPath` with a language endpoint
- [x] camel-util and camel-core full test suites pass (camel-core: 7838
tests, 0 failures)
_Claude Code on behalf of Claus Ibsen_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]