Bug fix: when validating a cache entry the protocol handlers must use the current request message with additional headers generated by the previous request interceptors instead of the original request message

This commit is contained in:
Oleg Kalnichevski 2023-11-15 15:16:56 +01:00
parent 67a0b52919
commit 1bbf5f4371
2 changed files with 2 additions and 2 deletions

View File

@ -770,7 +770,7 @@ class AsyncCachingExec extends CachingExecBase implements AsyncExecChainHandler
final Instant requestDate = getCurrentDate();
final HttpRequest conditionalRequest = conditionalRequestBuilder.buildConditionalRequest(
responseCacheControl,
BasicRequestBuilder.copy(scope.originalRequest).build(),
BasicRequestBuilder.copy(request).build(),
hit.entry);
final HttpClientContext context = scope.clientContext;
chainProceed(conditionalRequest, entityProducer, scope, chain, new AsyncExecCallback() {

View File

@ -343,7 +343,7 @@ class CachingExec extends CachingExecBase implements ExecChainHandler {
final HttpClientContext context = scope.clientContext;
Instant requestDate = getCurrentDate();
final ClassicHttpRequest conditionalRequest = conditionalRequestBuilder.buildConditionalRequest(
responseCacheControl, scope.originalRequest, hit.entry);
responseCacheControl, request, hit.entry);
ClassicHttpResponse backendResponse = chain.proceed(conditionalRequest, scope);
try {