HTTPCLIENT-2147: fixed broken preemptive auth in HC Fluent

This commit is contained in:
rrodewald 2021-04-06 18:12:49 +02:00 committed by Oleg Kalnichevski
parent 935abae04e
commit 8f31e6339d
1 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,7 @@ public class Executor {
public Executor authPreemptive(final HttpHost host) {
if (this.credentialsStore != null) {
final Credentials credentials = this.credentialsStore.getCredentials(new AuthScope(host), null);
if (credentials == null) {
if (credentials != null) {
final BasicScheme basicScheme = new BasicScheme();
basicScheme.initPreemptive(credentials);
this.authCache.put(host, basicScheme);
@ -152,7 +152,7 @@ public class Executor {
public Executor authPreemptiveProxy(final HttpHost proxy) {
if (this.credentialsStore != null) {
final Credentials credentials = this.credentialsStore.getCredentials(new AuthScope(proxy), null);
if (credentials == null) {
if (credentials != null) {
final BasicScheme basicScheme = new BasicScheme();
basicScheme.initPreemptive(credentials);
this.authCache.put(proxy, basicScheme);