davsclaus opened a new pull request, #30589:
URL: https://github.com/apache/camel/pull/30589

   [CAMEL-27381](https://issues.apache.org/jira/browse/CAMEL-27381)
   
   A `cxf:` consumer returns the headers of the reply message as HTTP response 
headers. The headers of the request stay on the message unless the route 
removes them, so `Host`, `User-Agent`, `Authorization`, `Cookie` and the other 
request headers were sent back to the client with the response. 
`camel-platform-http` already keeps the common HTTP request headers off its 
responses.
   
   ## Changes
   
   - `DefaultCxfBinding` leaves out the common HTTP request headers (the same 
list as `camel-platform-http`, compared without regard to case) when it builds 
the consumer's response: in `populateCxfResponseFromExchange` and in 
`populateCxfHeaderFromCamelExchangeBeforeCheckError` (the fault path).
   - Filtered in the binding, not in `CxfHeaderFilterStrategy`: the producer 
and the consumer share the strategy in the OUT direction, so the producer still 
sends `Authorization` and the other headers to the service. The headers of the 
Camel message are not changed (a copy is filtered).
   - A custom binding can override the new `protected boolean 
isHttpRequestHeader(String)` to return such a header.
   - cxf component page: new section "HTTP headers of the reply" (custom 
request headers and backend headers are still returned; `removeHeaders` example 
in Java, XML and YAML). Catalog copy updated.
   - Upgrade guide entry for 4.24.
   
   ## Tests
   
   - `CxfConsumerRequestHeadersTest`: a PAYLOAD consumer does not return 
`Authorization`, `cookie` (lower case), `User-Agent`, `Accept` or `Host`, and 
still returns the `X-Reply` header the route set; a binding overriding 
`isHttpRequestHeader` gets them back; a cxf producer still sends 
`Authorization`, `User-Agent` and a custom header to a backend.
   - camel-cxf-soap: 214 tests, 0 failures (4 skipped); camel-cxf-spring-soap 
(cxf-to-cxf routers, header relay): 161 tests, 0 failures (3 skipped).
   
   _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]

Reply via email to