parker89 commented on code in PR #929:
URL: 
https://github.com/apache/httpcomponents-client/pull/929#discussion_r4472683367


##########
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/AuthCacheKeeper.java:
##########
@@ -58,51 +59,112 @@ public AuthCacheKeeper(final SchemePortResolver 
schemePortResolver) {
         this.schemePortResolver = schemePortResolver;
     }
 
+    /**
+     * @since 5.7
+     */
+    public void updateCacheOnChallenge(final HttpHost host,
+                                       final Supplier<String> 
pathPrefixSupplier,
+                                       final AuthExchange authExchange,
+                                       final HttpContext context) {
+        clearCache(host, pathPrefixSupplier, HttpClientContext.cast(context));
+    }
+
+    /**
+     * @deprecated Do not use.
+     */
+    @Deprecated
     public void updateOnChallenge(final HttpHost host,
                                   final String pathPrefix,
                                   final AuthExchange authExchange,
                                   final HttpContext context) {
-        clearCache(host, pathPrefix, HttpClientContext.cast(context));
+        updateCacheOnNoChallenge(host, () -> pathPrefix, authExchange, 
context);

Review Comment:
   I think this should delegate to `updateCacheOnChallenge`. As written, the 
deprecated `updateOnChallenge` puts the scheme back in the cache on SUCCESS 
instead of clearing it. Minor, related: the deprecated wrappers turn a null 
`pathPrefix` into a non-null supplier, so `loadPreemptively(proxy, null, ...)` 
now looks up `get(host, null)` twice.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to