mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-16 15:07:27 +00:00
Bug fix: response Cache-Control attribute does not get updated in the cache execution context in case of a cache miss
This commit is contained in:
parent
aad0e9a9b5
commit
e7b3a5316c
@ -523,7 +523,9 @@ public void cancelled() {
|
||||
return asyncExecCallback.handleResponse(backendResponse, entityDetails);
|
||||
}
|
||||
|
||||
final HttpCacheContext context = HttpCacheContext.cast(scope.clientContext);
|
||||
final ResponseCacheControl responseCacheControl = CacheControlHeaderParser.INSTANCE.parse(backendResponse);
|
||||
context.setResponseCacheControl(responseCacheControl);
|
||||
final boolean cacheable = responseCachingPolicy.isResponseCacheable(responseCacheControl, request, backendResponse);
|
||||
if (cacheable) {
|
||||
storeRequestIfModifiedSinceFor304Response(request, backendResponse);
|
||||
|
@ -467,7 +467,9 @@ ClassicHttpResponse handleBackendResponse(
|
||||
}
|
||||
return backendResponse;
|
||||
}
|
||||
final HttpCacheContext context = HttpCacheContext.cast(scope.clientContext);
|
||||
final ResponseCacheControl responseCacheControl = CacheControlHeaderParser.INSTANCE.parse(backendResponse);
|
||||
context.setResponseCacheControl(responseCacheControl);
|
||||
final boolean cacheable = responseCachingPolicy.isResponseCacheable(responseCacheControl, request, backendResponse);
|
||||
if (cacheable) {
|
||||
storeRequestIfModifiedSinceFor304Response(request, backendResponse);
|
||||
|
Loading…
x
Reference in New Issue
Block a user