From cc6901798f1ee53b3dc8e67737f49698a03cf7c3 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 d9b89497c..d009a3422 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 @@ class AsyncCachingExec extends CachingExecBase implements AsyncExecChainHandler 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);