CAMEL-24418: camel-http/http-common/undertow - do not resolve property placeholders in the CamelHttpUri header - #25571
Open
oscerd wants to merge 1 commit into
Open
CAMEL-24418: camel-http/http-common/undertow - do not resolve property placeholders in the CamelHttpUri header#25571oscerd wants to merge 1 commit into
oscerd wants to merge 1 commit into
Conversation
oscerd
force-pushed
the
fix/CAMEL-24418
branch
from
August 21, 2026 20:26
f69c5dd to
1c892a1
Compare
…y placeholders in the CamelHttpUri header
Four sites resolved property placeholders ({{...}}) on the value of the
CamelHttpUri message header:
* camel-http HttpMethodHelper.createMethod (guarded by skipControlHeaders,
which defaults to false)
* camel-http-common HttpHelper.createMethod (no guard)
* camel-http-common HttpHelper.createURL (no guard; resolves on CamelHttpUri
whenever the endpoint is not bridging)
* camel-undertow UndertowHelper.createMethod (no guard)
That header carries message content, while property placeholders are a route
and configuration authoring feature resolved at build time on the endpoint uri
written in the route. This is the same alignment CAMEL-24282 applied to toD and
enrich. camel-http-common backs camel-servlet and camel-jetty, so the two
unguarded createMethod/createURL paths reach more deployments than the
camel-http one.
UndertowHelper.createURL is deliberately left as it is: its uri comes either
from the CamelRestHttpUri header, which sits inside the Camel* namespace and is
therefore blocked on the inbound path by the default header filter, or from the
endpoint uri, which was already resolved at build time. It is never message
content. Folding it in for consistency is worth doing but is a separate change.
Removing the calls left the RuntimeExchangeException import unused in
HttpMethodHelper and HttpHelper; both are removed.
Adds HttpUriHeaderPlaceholderTest in camel-http (camel-http-common has no http
component registered, so an endpoint cannot be created there) covering both
directions: a placeholder in the header stays literal, and a placeholder in the
endpoint uri is still resolved. The literal token comes back percent-encoded by
UnsafeUriCharactersEncoder, like any other unsafe character in a header-supplied
uri, and the test documents that.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
oscerd
force-pushed
the
fix/CAMEL-24418
branch
from
August 21, 2026 20:28
1c892a1 to
c8eb0a8
Compare
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 74 tested, 28 compile-only — current: 73 all testedMaveniverse Scalpel detected 102 affected modules (current approach: 73).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes CAMEL-24418. Companion to #25569 — same contract, different layer.
Problem
Four sites resolved property placeholders on the value of the
CamelHttpUriheader:camel-httpHttpMethodHelper.createMethodskipControlHeaders, which defaults tofalsecamel-http-commonHttpHelper.createMethodcamel-http-commonHttpHelper.createURLCamelHttpUriwhenever the endpoint is not bridgingcamel-undertowUndertowHelper.createMethodThat header carries message content, while property placeholders are a route/configuration authoring feature resolved at build time on the endpoint URI written in the route — the same contract CAMEL-24282 restored for
toDandenrich.Note camel-http-common backs camel-servlet and camel-jetty, so the two unguarded paths there reach considerably more deployments than the camel-http one that at least had an off switch.
Deliberately not changed
UndertowHelper.createURLstill resolves placeholders, and that is intentional. Its URI comes either from theCamelRestHttpUriheader — which sits inside theCamel*namespace and is therefore blocked on the inbound path by the default header filter — or from the endpoint URI, already resolved at build time. It is never message content. Folding it in for consistency is worth doing but is a separate change, so I left it visible rather than sweeping it in.Removing the calls left the
RuntimeExchangeExceptionimport unused in two files; both removed.Tests
HttpUriHeaderPlaceholderTestlives in camel-http, because camel-http-common has nohttpcomponent registered and an endpoint cannot be created there. It covers both directions:One behaviour detail the test pins down: the literal token comes back percent-encoded (
%7B%7BsecretValue%7D%7D) viaUnsafeUriCharactersEncoder, like any other unsafe character in a header-supplied URI.Backport
main only, matching CAMEL-24282 and #25569. Behaviour change, upgrade-guide entry included.
_Claude Code on behalf of