Skip to content
Merged
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 @@ -334,26 +334,25 @@ private boolean needAuthentication(
}
}

boolean targetNeedsAuth = false;
boolean proxyNeedsAuth = false;
if (targetAuthRequested || targetMutualAuthRequired) {
final boolean updated = authenticator.handleResponse(target, ChallengeType.TARGET, response,
targetNeedsAuth = authenticator.handleResponse(target, ChallengeType.TARGET, response,
targetAuthStrategy, targetAuthExchange, context);

if (authCacheKeeper != null) {
authCacheKeeper.updateOnResponse(target, pathPrefix, targetAuthExchange, context);
}

return updated;
}
if (proxyAuthRequested || proxyMutualAuthRequired) {
final boolean updated = authenticator.handleResponse(proxy, ChallengeType.PROXY, response,
proxyNeedsAuth = authenticator.handleResponse(proxy, ChallengeType.PROXY, response,
proxyAuthStrategy, proxyAuthExchange, context);

if (authCacheKeeper != null) {
authCacheKeeper.updateOnResponse(proxy, null, proxyAuthExchange, context);
}

return updated;
}
return targetNeedsAuth || proxyNeedsAuth;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public boolean isChallenged(
}

/**
* Determines whether the given response represents an authentication challenge, without
* changing the {@link AuthExchange} state.
* Determines whether the given response represents an authentication challenge
* of challangeType, without changing the {@link AuthExchange} state.
*
* @param challengeType the challenge type (target or proxy).
* @param response the response message head.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,26 +295,25 @@ private boolean needAuthentication(
}
}

boolean targetNeedsAuth = false;
boolean proxyNeedsAuth = false;
if (targetAuthRequested || targetMutualAuthRequired) {
final boolean updated = authenticator.handleResponse(target, ChallengeType.TARGET, response,
targetNeedsAuth = authenticator.handleResponse(target, ChallengeType.TARGET, response,
targetAuthStrategy, targetAuthExchange, context);

if (authCacheKeeper != null) {
authCacheKeeper.updateOnResponse(target, pathPrefix, targetAuthExchange, context);
}

return updated;
}
if (proxyAuthRequested || proxyMutualAuthRequired) {
final boolean updated = authenticator.handleResponse(proxy, ChallengeType.PROXY, response,
proxyNeedsAuth = authenticator.handleResponse(proxy, ChallengeType.PROXY, response,
proxyAuthStrategy, proxyAuthExchange, context);

if (authCacheKeeper != null) {
authCacheKeeper.updateOnResponse(proxy, null, proxyAuthExchange, context);
}

return updated;
}
return targetNeedsAuth || proxyNeedsAuth;
}
return false;
}
Expand Down