Skip to content

Commit bf18865

Browse files
committed
Addressing PR feedback
1 parent 29578a8 commit bf18865

File tree

1 file changed

+2
-1
lines changed
  • http-clients/apache-client/src/main/java/software/amazon/awssdk/http/apache/internal/utils

1 file changed

+2
-1
lines changed

http-clients/apache-client/src/main/java/software/amazon/awssdk/http/apache/internal/utils/ApacheUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.apache.http.auth.AUTH;
2323
import org.apache.http.auth.AuthScope;
2424
import org.apache.http.auth.Credentials;
25+
import org.apache.http.auth.MalformedChallengeException;
2526
import org.apache.http.auth.NTCredentials;
2627
import org.apache.http.client.AuthCache;
2728
import org.apache.http.client.CredentialsProvider;
@@ -153,10 +154,10 @@ private static void addPreemptiveAuthenticationProxy(HttpClientContext clientCon
153154
BasicScheme basicAuth = new BasicScheme();
154155
try {
155156
basicAuth.processChallenge(new BasicHeader(AUTH.PROXY_AUTH, "BASIC realm=default"));
157+
authCache.put(targetHost, basicAuth);
156158
} catch (Exception e) {
157159
logger.warn(() -> "Failed to process synthetic challenge for preemptive proxy authentication: " + e.getMessage());
158160
}
159-
authCache.put(targetHost, basicAuth);
160161

161162
clientContext.setCredentialsProvider(credsProvider);
162163
clientContext.setAuthCache(authCache);

0 commit comments

Comments
 (0)