[
https://issues.apache.org/jira/browse/CAMEL-12642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16549413#comment-16549413
]
ASF GitHub Bot commented on CAMEL-12642:
----------------------------------------
GitHub user ramu11 opened a pull request:
https://github.com/apache/camel/pull/2432
CAMEL-12642:Fix for http4 feature authenticationPreemptive in pollEnrich
CAMEL-12642:Fix for http4 feature authenticationPreemptive in pollEnrich
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ramu11/camel master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/2432.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2432
----
commit 7cf0f65dc8aa9bb0712331ca92fe7ca01896d35a
Author: Ramu <kkakarla@...>
Date: 2018-07-19T15:09:48Z
CAMEL-12642:Fix for http4 feature authenticationPreemptive in pollEnrich
----
> 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
>
> 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)