Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: net/http/http_auth_controller.cc

Issue 2505203002: [net/auth] Reset AuthChallengeInfo before picking a new HttpAuthHandler. (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_controller.cc
diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc
index 01245a9b8c7f9af7f94e306302740518ef6450c3..8840976d47a348ba7dbd969ca76d9406f431e142 100644
--- a/net/http/http_auth_controller.cc
+++ b/net/http/http_auth_controller.cc
@@ -146,6 +146,7 @@ int HttpAuthController::MaybeGenerateAuthToken(
const CompletionCallback& callback,
const NetLogWithSource& net_log) {
DCHECK(CalledOnValidThread());
+ DCHECK(!auth_info_);
bool needs_auth = HaveAuth() || SelectPreemptiveAuth(net_log);
if (!needs_auth)
return OK;
@@ -227,6 +228,7 @@ int HttpAuthController::HandleAuthChallenge(
DCHECK(CalledOnValidThread());
DCHECK(headers.get());
DCHECK(auth_origin_.is_valid());
+ DCHECK(!auth_info_);
// Give the existing auth handler first try at the authentication headers.
// This will also evict the entry in the HttpAuthCache if the previous
@@ -277,7 +279,6 @@ int HttpAuthController::HandleAuthChallenge(
}
identity_.invalid = true;
-
bool can_send_auth = (target_ != HttpAuth::AUTH_SERVER ||
!do_not_send_server_auth);
@@ -326,8 +327,6 @@ int HttpAuthController::HandleAuthChallenge(
// Pass the challenge information back to the client.
PopulateAuthChallenge();
}
- } else {
- auth_info_ = NULL;
}
// If we get here and we don't have a handler_, that's because we
@@ -348,6 +347,9 @@ void HttpAuthController::ResetAuth(const AuthCredentials& credentials) {
identity_.source = HttpAuth::IDENT_SRC_EXTERNAL;
identity_.invalid = false;
identity_.credentials = credentials;
+
+ // auth_info_ is no longer necessary.
+ auth_info_ = nullptr;
}
DCHECK(identity_.source != HttpAuth::IDENT_SRC_PATH_LOOKUP);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698