camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Minh Tran (JIRA)" <>
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
             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

This is a working example
setHeader(Exchange.HTTP_METHOD, constant("POST")).
The output from apache httpclient logging is showing the Authorization header being correctly
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==

Now we do the same but use Exchange.HTTP_URI
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

This is the output of apache httpclient logs
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
Notice the missing Authorization header and the path includes the uri options as well

This message was sent by Atlassian JIRA

View raw message