camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Minh Tran (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-9396) http4 and Exchange.HTTP_URI
Date Mon, 07 Dec 2015 00:37:10 GMT
Minh Tran created CAMEL-9396:
--------------------------------

             Summary: http4 and Exchange.HTTP_URI
                 Key: CAMEL-9396
                 URL: https://issues.apache.org/jira/browse/CAMEL-9396
             Project: Camel
          Issue Type: Bug
          Components: camel-http4
    Affects Versions: 2.16.1
         Environment: jdk7, mac
            Reporter: Minh Tran


It seems that when using Exchange.HTTP_URI, the options added in here doesn't get stripped
off the actual request and is being interpretted as part of the url rather than as an endpoint
option. 

This is a working example
{noformat}
from("direct:start").
setHeader(Exchange.HTTP_METHOD, constant("POST")).
to("http4:localhost:8080/path?authenticationPreemptive=true&authUsername=myUser&authPassword=myPass");
{noformat}
The output from apache httpclient logging is showing the Authorization header being correctly
set
{noformat}
2015-12-07 11:29:51,139 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> POST
/path HTTP/1.1
2015-12-07 11:29:51,140 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Authorization:
Basic bXlVc2VyOm15UGFzcw==
{noformat}

Now we do the same but use Exchange.HTTP_URI
{noformat}
from("direct:start").
setHeader(Exchange.HTTP_METHOD, constant("POST")).
setHeader(Exchange.HTTP_URI, constant("http4://localhost:8080/newPath?authenticationPreemptive=true&authUsername=myUser&authPassword=myPass")).
// deliberately changed settings here to verify we are not hitting it
to("https4:host:80/path");
{noformat}

This is the output of apache httpclient logs
{noformat}
2015-12-07 11:32:19,595 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> POST
/newPath?authenticationPreemptive=true&authUsername=myUser&authPassword=myPass HTTP/1.1
{noformat}
Notice the missing Authorization header and the path includes the uri options as well



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message