Andrea Cosentino created CAMEL-24455:
----------------------------------------

             Summary: camel-platform-http - any path starting with "proxy" 
selects HTTP proxy mode
                 Key: CAMEL-24455
                 URL: https://issues.apache.org/jira/browse/CAMEL-24455
             Project: Camel
          Issue Type: Bug
          Components: camel-platform-http
            Reporter: Andrea Cosentino
            Assignee: Andrea Cosentino
             Fix For: 4.23.0


{{PlatformHttpEndpoint.isHttpProxy()}} tests {{path.startsWith(PROXY_PATH)}} 
where {{PROXY_PATH = "proxy"}}, rather than comparing for equality. Any 
endpoint whose path begins with those five characters - {{proxyStats}}, 
{{proxy-health}}, {{proxying}} - is treated as the documented 
{{platform-http:proxy}} endpoint.

The consequences chain: {{getPath()}} returns {{"/"}} for such an endpoint, 
making it a catch-all, and {{VertxPlatformHttpConsumer.handleProxy()}} sets 
{{Exchange.HTTP_HOST}} from the request's own {{Host}} header so that a 
bridging producer forwards there.

A route author naming an endpoint {{proxyStats}} therefore gets a catch-all 
whose forward target comes from the caller, which is not what the name suggests.

Proposal: compare the path for equality with {{PROXY_PATH}} (allowing a leading 
slash), so proxy mode is selected only by the documented path. Needs an 
upgrade-guide entry for anyone relying on the prefix match.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to