ok2c commented on code in PR #464:
URL: 
https://github.com/apache/httpcomponents-client/pull/464#discussion_r1244842939


##########
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExec.java:
##########
@@ -346,20 +350,19 @@ ClassicHttpResponse revalidateCacheEntry(
             }
 
             if (statusCode == HttpStatus.SC_NOT_MODIFIED) {
-                final HttpCacheEntry updatedEntry = responseCache.updateEntry(
-                        target, request, cacheEntry, backendResponse, 
requestDate, responseDate);
+                final CacheHit updated = responseCache.update(hit, request, 
backendResponse, requestDate, responseDate);
                 if (suitabilityChecker.isConditional(request)
-                        && suitabilityChecker.allConditionalsMatch(request, 
updatedEntry, Instant.now())) {
-                    return 
convert(responseGenerator.generateNotModifiedResponse(updatedEntry), scope);
+                        && suitabilityChecker.allConditionalsMatch(request, 
updated.entry, Instant.now())) {
+                    return 
convert(responseGenerator.generateNotModifiedResponse(updated.entry), scope);
                 }
-                return convert(responseGenerator.generateResponse(request, 
updatedEntry), scope);
+                return convert(responseGenerator.generateResponse(request, 
updated.entry), scope);
             }
 
             if (staleIfErrorAppliesTo(statusCode)
-                    && !staleResponseNotAllowed(requestCacheControl, 
responseCacheControl, cacheEntry, getCurrentDate())
-                    && 
validityPolicy.mayReturnStaleIfError(requestCacheControl, responseCacheControl, 
cacheEntry, responseDate)) {
+                    && !staleResponseNotAllowed(requestCacheControl, 
responseCacheControl, hit, getCurrentDate())

Review Comment:
   @arturobernalg Done.



-- 
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