Croway opened a new pull request, #26114:
URL: https://github.com/apache/camel/pull/26114
## Problem
`platform-http` is the one HTTP consumer that does not make `CamelHttpPath`
relative to its own registered path - `camel-servlet`, `camel-jetty`,
`camel-netty-http` and `camel-undertow` all strip their registered consumer
path already. This means combining `platform-http` with the `camel-http`
producer's `bridgeEndpoint=true` to build a zero-code, path-based reverse proxy
doesn't work: the full raw request path is forwarded instead of the path
relative to the consumer, forcing route authors to manually strip the prefix
with `setHeader` + a Simple/OGNL `substring()` expression.
## Change
Adds a new consumer option `stripUriPrefix` (default `false`) on
`platform-http`:
```java
from("platform-http:/reverse-proxy?matchOnUriPrefix=true&stripUriPrefix=true")
.to("http://backend?bridgeEndpoint=true") // /reverse-proxy/get ->
http://backend/get
```
- New shared, defensive pure function
`HttpHelper.stripUriPrefix(requestPath, consumerPath)` in `camel-http-base`,
usable by other HTTP consumers in the future.
- New `stripUriPrefix` consumer option on `PlatformHttpEndpoint`
(engine-agnostic).
- Wired up in the Vert.x engine (`camel-platform-http-vertx`); the Spring
Boot engine is not wired in this PR.
- `CamelHttpUri`/`CamelHttpUrl` are left untouched - only `CamelHttpPath` is
rewritten.
- Default is unchanged (`false`), and the existing `platform-http:proxy`
forward-proxy mode (`CAMEL-24455`) is provably unaffected: its consumer path is
`"/"`, and the helper treats a consumer path of `"/"` as "nothing to strip".
- Docs added to `platform-http-component.adoc`.
This is not yet linked to a JIRA ticket - one is being filed. Opening as a
**draft** pending review from the author (a Camel committer) before it's marked
ready for review.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Tgb2b9DSh1ncG7C82rwzsE
--
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]