[ 
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16552904#comment-16552904
 ] 

ASF GitHub Bot commented on CAMEL-12642:
----------------------------------------

oscerd commented on issue #2432: CAMEL-12642:Fix for http4 feature 
authenticationPreemptive in pollEnrich
URL: https://github.com/apache/camel/pull/2432#issuecomment-407067809
 
 
   Thanks, merged on master.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> No support for http4 feature authenticationPreemptive in pollEnrich
> -------------------------------------------------------------------
>
>                 Key: CAMEL-12642
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12642
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-http4
>    Affects Versions: 2.23.0
>            Reporter: Frank Olschewski
>            Assignee: Ramu
>            Priority: Major
>             Fix For: 2.23.0
>
>
> authenticationPreemptive=true does not work with pollEnrich.
> {code:java}
> .pollEnrich("https4:localhost?authenticationPreemptive=true" +
>    "&authUsername=user&authPassword=passwd"){code}
> In Class /org/apache/camel/component/http4/HttpPollingConsumer.java:79 you 
> see the following code:
> {code:java}
> HttpResponse response = httpClient.execute(method, httpClientContext);{code}
> The setup for authenticationPreemptive is missing.
> You can see what to do in 
> org.apache.camel.component.http4.HttpProducer#executeMethod:
> {code:java}
> pprotected HttpResponse executeMethod(HttpUriRequest httpRequest) throws 
> IOException {
>     HttpContext localContext = new BasicHttpContext();
>     if (getEndpoint().isAuthenticationPreemptive()) {
>         BasicScheme basicAuth = new BasicScheme();
>         localContext.setAttribute("preemptive-auth", basicAuth);
>     }
>     if (httpContext != null) {
>         localContext = new BasicHttpContext(httpContext);
>     }
>     return httpClient.execute(httpRequest, localContext);
> }{code}
>  In org.apache.camel.component.http4.HttpPollingConsumer#doReceive 
> getEndpoint().isAuthenticationPreemptive() returns the correct value, so 
> there is nothing against implementing this feature here as well.
> The problem behind the scene ist that the context attribute "preemptive-auth" 
> is missing.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to