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

Unified Diff: net/http/http_auth_handler.cc

Issue 6525035: Invalidate credentials if the server rejects them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify auth handlers for basic and digest Created 9 years, 10 months 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
Index: net/http/http_auth_handler.cc
diff --git a/net/http/http_auth_handler.cc b/net/http/http_auth_handler.cc
index 51bd6aabf18a42b58bd67a4089565c513d531186..2e0e8a85f238ba63d544a7a1e7f1fa9a553db331 100644
--- a/net/http/http_auth_handler.cc
+++ b/net/http/http_auth_handler.cc
@@ -5,6 +5,7 @@
#include "net/http/http_auth_handler.h"
#include "base/logging.h"
+#include "base/string_util.h"
#include "net/base/net_errors.h"
namespace net {
@@ -46,6 +47,21 @@ bool HttpAuthHandler::InitFromChallenge(
return ok;
}
+// At a minimum, we check for a 'realm' directive in the
+// authentication challenge.
+bool HttpAuthHandler::ShouldInvalidateRejectedAuth(
+ HttpAuth::ChallengeTokenizer* challenge) {
+ HttpUtil::NameValuePairsIterator parameters = challenge->param_pairs();
+ std::string realm;
+ while (parameters.GetNext()) {
+ if (LowerCaseEqualsASCII(parameters.name(), "realm")) {
+ realm = parameters.value();
+ break;
+ }
+ }
+ return (realm == realm_);
+}
+
namespace {
NetLog::EventType EventTypeFromAuthTarget(HttpAuth::Target target) {

Powered by Google App Engine
This is Rietveld 408576698