Skip to content

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
apache:mainfrom
oscerd:fix/CAMEL-24418
Open

CAMEL-24418: camel-http/http-common/undertow - do not resolve property placeholders in the CamelHttpUri header#25571
oscerd wants to merge 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24418

Conversation

@oscerd

@oscerd oscerd commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Fixes CAMEL-24418. Companion to #25569 — same contract, different layer.

Problem

Four sites resolved property placeholders on the value of the CamelHttpUri header:

Site Guarded?
camel-http HttpMethodHelper.createMethod by skipControlHeaders, which defaults to false
camel-http-common HttpHelper.createMethod no
camel-http-common HttpHelper.createURL no — resolves on CamelHttpUri whenever the endpoint is not bridging
camel-undertow UndertowHelper.createMethod no
uriString = exchange.getContext().resolvePropertyPlaceholders(uriString);

That 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 toD and enrich.

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.createURL still resolves placeholders, and that is intentional. 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, 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 RuntimeExchangeException import unused in two files; both removed.

Tests

HttpUriHeaderPlaceholderTest lives in camel-http, because camel-http-common has no http component registered and an endpoint cannot be created there. It covers both directions:

  • a placeholder in the header stays literal
  • a placeholder in the endpoint URI is still resolved, exactly as before

One behaviour detail the test pins down: the literal token comes back percent-encoded (%7B%7BsecretValue%7D%7D) via UnsafeUriCharactersEncoder, like any other unsafe character in a header-supplied URI.

mvn test -Dtest=HttpUriHeaderPlaceholderTest   # 2 passed
mvn clean install -DskipTests                  # full reactor, BUILD SUCCESS

Backport

main only, matching CAMEL-24282 and #25569. Behaviour change, upgrade-guide entry included.


_Claude Code on behalf of

@oscerd
oscerd requested review from davsclaus and gnodet August 21, 2026 18:55
…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>
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-http-common
  • components/camel-http
  • components/camel-undertow
  • docs

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.


🔬 Scalpel shadow comparison — Scalpel: 74 tested, 28 compile-only — current: 73 all tested

Maveniverse Scalpel detected 102 affected modules (current approach: 73).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 74 modules (4 direct + 70 downstream), skip tests for 28 (generated code, meta-modules)

Modules Scalpel would test (74)
  • camel-a2a
  • camel-ai-observability
  • camel-as2
  • camel-atmosphere-websocket
  • camel-clickup
  • camel-consul
  • camel-cxf-rest
  • camel-cxf-soap
  • camel-cxf-spring-rest
  • camel-cxf-spring-soap
  • camel-cxf-spring-transport
  • camel-cxf-transport
  • camel-graphql
  • camel-http
  • camel-http-common
  • camel-java-joor-dsl
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-jetty
  • camel-jetty-common
  • camel-jsonpath
  • camel-kamelet
  • camel-knative-http
  • camel-kubernetes
  • camel-langchain4j-chat
  • camel-langchain4j-embeddings
  • camel-langchain4j-embeddingstore
  • camel-langchain4j-tools
  • camel-launcher-container
  • camel-lra
  • camel-mcp-server
  • camel-micrometer-observability
  • camel-micrometer-prometheus
  • camel-netty-http
  • camel-oauth
  • camel-observability-services
  • camel-openai
  • camel-openapi-validator
  • camel-opentelemetry
  • camel-opentelemetry2
  • camel-platform-http
  • camel-platform-http-jolokia
  • camel-platform-http-main
  • camel-platform-http-vertx
  • camel-quickfix
  • camel-rest-openapi
  • camel-rest-postman
  • camel-restdsl-openapi-plugin
  • camel-sap-netweaver
  • camel-servlet
  • camel-slack
  • camel-soap
  • camel-spring-rabbitmq
  • camel-telegram
  • camel-telemetry
  • camel-telemetry-dev
  • camel-test-main-junit5
  • camel-test-main-junit6
  • camel-undertow
  • camel-undertow-spring-security
  • camel-vertx-http
  • camel-webhook
  • camel-whatsapp
  • camel-xml-io-dsl
  • camel-xml-jaxb-dsl
  • camel-xml-jaxb-dsl-test-definition
  • camel-xml-jaxb-dsl-test-spring
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
  • camel-zookeeper
  • docs
Modules with tests skipped (28)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more


⚙️ View full build and test results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant