From e6a410439f5eb26f8eb35f0758ad1e018765bb87 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Mon, 14 Oct 2024 17:58:35 +0200 Subject: [PATCH] Bug fix: async cache protocol handler incorrectly updates the actual cache entry in the cache execution context upon cache entry re-validation --- .../org/apache/hc/client5/http/impl/cache/AsyncCachingExec.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AsyncCachingExec.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AsyncCachingExec.java index 9848f55942..a6ad156c05 100644 --- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AsyncCachingExec.java +++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AsyncCachingExec.java @@ -877,7 +877,7 @@ void triggerUpdatedCacheEntryResponse(final HttpResponse backendResponse, final public void completed(final CacheHit updated) { try { final SimpleHttpResponse cacheResponse = generateCachedResponse(request, updated.entry, responseDate); - context.setCacheEntry(hit.entry); + context.setCacheEntry(updated.entry); triggerResponse(cacheResponse, scope, asyncExecCallback); } catch (final ResourceIOException ex) { asyncExecCallback.failed(ex);