You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Maxime Tremblay (JIRA)" <ji...@apache.org> on 2012/10/29 17:14:12 UTC

[jira] [Created] (CAMEL-5757) HTTP 1.1 Host header not set correctly with camel-http4

Maxime Tremblay created CAMEL-5757:
--------------------------------------

             Summary: HTTP 1.1 Host header not set correctly with camel-http4
                 Key: CAMEL-5757
                 URL: https://issues.apache.org/jira/browse/CAMEL-5757
             Project: Camel
          Issue Type: Bug
          Components: camel-http
    Affects Versions: 2.10.1
            Reporter: Maxime Tremblay


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&amp;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]"


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-5757) HTTP 1.1 Host header not set correctly with camel-http4

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486744#comment-13486744 ] 

Willem Jiang commented on CAMEL-5757:
-------------------------------------

Hi,

You can remove the header "host" from the message to avoid the bridgeEndpoint resend the message for you.
I think we could help people to filter these header if the bridgeEndpoint option is set to be true.

Willem

                
> HTTP 1.1 Host header not set correctly with camel-http4
> -------------------------------------------------------
>
>                 Key: CAMEL-5757
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5757
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http
>    Affects Versions: 2.10.1
>            Reporter: Maxime Tremblay
>
> 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&amp;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]"

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CAMEL-5757) HTTP 1.1 Host header not set correctly with camel-http4

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-5757.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.11.0
                   2.10.3
                   2.9.5

Applied patch into trunk, camel-2.10.x and camel-2.9.x branches.
                
> HTTP 1.1 Host header not set correctly with camel-http4
> -------------------------------------------------------
>
>                 Key: CAMEL-5757
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5757
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http
>    Affects Versions: 2.10.1
>            Reporter: Maxime Tremblay
>            Assignee: Willem Jiang
>             Fix For: 2.9.5, 2.10.3, 2.11.0
>
>
> 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&amp;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]"

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CAMEL-5757) HTTP 1.1 Host header not set correctly with camel-http4

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CAMEL-5757:
-----------------------------------

    Assignee: Willem Jiang
    
> HTTP 1.1 Host header not set correctly with camel-http4
> -------------------------------------------------------
>
>                 Key: CAMEL-5757
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5757
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http
>    Affects Versions: 2.10.1
>            Reporter: Maxime Tremblay
>            Assignee: Willem Jiang
>
> 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&amp;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]"

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira