Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.10.1
-
None
-
Unknown
Description
The HTTP 1.1 Host header is not set correctly when using the camel-http4 component as a proxy with bridgeEnpoint=true.
The original request Host header is set in the proxied request instead of the host of the service requested by the proxy (ref: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html section 14.23).
This simple route shows the problem:
<route autoStartup="true" id="TestHost" xmlns:ns2="http://camel.apache.org/schema/web" xmlns="http://camel.apache.org/schema/spring">
<from uri="jetty:http://0.0.0.0:8090/TestHost"/>
<to uri="https4://www.google.com?bridgeEndpoint=true&throwExceptionOnFailure=false"/>
</route>
This is what I get in the log:
INFO | jvm 1 | 2012/10/26 14:52:48 | [ qtp31541880-35 - /TestHost] DefaultClientConnection DEBUG Sending request: GET / HTTP/1.1
INFO | jvm 1 | 2012/10/26 14:52:48 | [ qtp31541880-35 - /TestHost] wire DEBUG >> "GET / HTTP/1.1[\r][\n]"
INFO | jvm 1 | 2012/10/26 14:52:48 | [ qtp31541880-35 - /TestHost] wire DEBUG >> "breadcrumbId: ID-localhost-1329-1351277552803-0-2[\r][\n]"
INFO | jvm 1 | 2012/10/26 14:52:48 | [ qtp31541880-35 - /TestHost] wire DEBUG >> "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0[\r][\n]"
INFO | jvm 1 | 2012/10/26 14:52:48 | [ qtp31541880-35 - /TestHost] wire DEBUG >> "Accept-Encoding: gzip, deflate[\r][\n]"
INFO | jvm 1 | 2012/10/26 14:52:48 | [ qtp31541880-35 - /TestHost] wire DEBUG >> "Host: localhost:8090[\r][\n]"
INFO | jvm 1 | 2012/10/26 14:52:48 | [ qtp31541880-35 - /TestHost] wire DEBUG >> "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8[\r][\n]"
INFO | jvm 1 | 2012/10/26 14:52:48 | [ qtp31541880-35 - /TestHost] wire DEBUG >> "Accept-Language: en-us,en;q=0.5[\r][\n]"
INFO | jvm 1 | 2012/10/26 14:52:48 | [ qtp31541880-35 - /TestHost] wire DEBUG >> "Connection: Keep-Alive[\r][\n]"
INFO | jvm 1 | 2012/10/26 14:52:48 | [ qtp31541880-35 - /TestHost] wire DEBUG >> "[\r][\n]"