[
https://issues.apache.org/jira/browse/CAMEL-6185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13808313#comment-13808313
]
Christian Posta commented on CAMEL-6185:
----------------------------------------
Thanks Claus. You're right -- all of the previously listed components also have
a header filter strategy that doesn't take into account HOST. I have a patch
almost complete.
The camel-jetty component, however, has a dependency on the camel-http
component. So it does not directly need any patching.
Should have this fixed shortly.
> http4 component should always filter 'host' header
> --------------------------------------------------
>
> Key: CAMEL-6185
> URL: https://issues.apache.org/jira/browse/CAMEL-6185
> Project: Camel
> Issue Type: Bug
> Components: camel-ahc, camel-http, camel-http4, camel-jetty,
> camel-netty-http
> Affects Versions: 2.10.4
> Reporter: Fried Hoeben
> Assignee: Christian Posta
> Fix For: 2.12.2, 2.13.0
>
>
> Exchanges originating from a CXF consumer get an incorrect 'host' http-header
> when directed to a http4 producer. The problem is that the cxf consumer
> copies the incoming 'host' header to the message, and the http4 producer
> copies this to the outgoing message. The http component does not do that.
> When sending a http request the HttpProducer copies headers from the
> incomming message to the HTTP request. The 'host' header should not be copied
> since it (according to the http spec) should always contain the name of the
> server the request is sent to.
> This has already been addressed for bridge endpoints (CAMEL-5757), but is
> always an issue.
> The easiest fix seems to be to add the 'host' header to the list of out going
> filters in
> org.apache.camel.component.http4.HttpHeaderFilterStrategy.initialize() i.e.:
> {code}
> getOutFilter().add("host");
> {code}
> Once this is done the special handling (i.e. removal of) of 'host' header in
> case of bridgeEndpoint inside HttpProducer can be removed (since the strategy
> will remove it):
> {code}
> // Need to remove the Host key as it should be not used
> exchange.getIn().getHeaders().remove("host");
> {code}
--
This message was sent by Atlassian JIRA
(v6.1#6144)