Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ public void cancelled() {
context.setResponseCacheControl(responseCacheControl);
final boolean cacheable = responseCachingPolicy.isResponseCacheable(
requestCacheControl, responseCacheControl, request, backendResponse,
isTargetAuthenticated(context, scope.route));
isTargetAuthenticated(request, scope.route, context));
if (cacheable) {
storeRequestIfModifiedSinceFor304Response(request, backendResponse);
if (LOG.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ ClassicHttpResponse handleBackendResponse(
context.setResponseCacheControl(responseCacheControl);
final boolean cacheable = responseCachingPolicy.isResponseCacheable(
requestCacheControl, responseCacheControl, request, backendResponse,
isTargetAuthenticated(context, scope.route));
isTargetAuthenticated(request, scope.route, context));
if (cacheable) {
storeRequestIfModifiedSinceFor304Response(request, backendResponse);
if (LOG.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@ public long getCacheUpdates() {
* request last sent to the backend. A connection-based scheme does not resend
* the header once the exchange has succeeded, so check the exchange state as well.
*/
static boolean isTargetAuthenticated(final HttpClientContext context, final HttpRoute route) {
final HttpRequest sentRequest = context.getRequest();
if (sentRequest != null && sentRequest.containsHeader(HttpHeaders.AUTHORIZATION)) {
static boolean isTargetAuthenticated(final HttpRequest request, final HttpRoute route, final HttpClientContext context) {
if (request.containsHeader(HttpHeaders.AUTHORIZATION)) {
return true;
}
final AuthExchange authExchange = context.getAuthExchanges().get(route.getTargetHost());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected void customizeExecChain(final NamedElementChain<AsyncExecChainHandler>
httpCache,
cacheRevalidator,
config);
execChainDefinition.addBefore(ChainElement.PROTOCOL.name(), cachingExec, ChainElement.CACHING.name());
execChainDefinition.addAfter(ChainElement.PROTOCOL.name(), cachingExec, ChainElement.CACHING.name());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected void customizeExecChain(final NamedElementChain<AsyncExecChainHandler>
httpCache,
cacheRevalidator,
config);
execChainDefinition.addBefore(ChainElement.PROTOCOL.name(), cachingExec, ChainElement.CACHING.name());
execChainDefinition.addAfter(ChainElement.PROTOCOL.name(), cachingExec, ChainElement.CACHING.name());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected void customizeExecChain(final NamedElementChain<ExecChainHandler> exec
httpCache,
cacheRevalidator,
config);
execChainDefinition.addBefore(ChainElement.PROTOCOL.name(), cachingExec, ChainElement.CACHING.name());
execChainDefinition.addAfter(ChainElement.PROTOCOL.name(), cachingExec, ChainElement.CACHING.name());
}

@Override
Expand Down
Loading