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

Unified Diff: net/http/http_auth_handler_basic.cc

Issue 1157333005: [net/http auth] Use strings to identify authentication schemes. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « net/http/http_auth_handler.cc ('k') | net/http/http_auth_handler_digest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_basic.cc
diff --git a/net/http/http_auth_handler_basic.cc b/net/http/http_auth_handler_basic.cc
index 27b892bb016b2670266a0c7c6ce40fd1e95cb41a..4c509f46bb2d7b2e42bd7f4511575258adc567a3 100644
--- a/net/http/http_auth_handler_basic.cc
+++ b/net/http/http_auth_handler_basic.cc
@@ -18,6 +18,8 @@ namespace net {
namespace {
+const char* const kBasicSchemeName = "basic";
+
// Parses a realm from an auth challenge, and converts to UTF8-encoding.
// Returns whether the realm is invalid or the parameters are invalid.
//
@@ -53,16 +55,14 @@ bool ParseRealm(const HttpAuthChallengeTokenizer& tokenizer,
} // namespace
bool HttpAuthHandlerBasic::Init(HttpAuthChallengeTokenizer* challenge) {
- auth_scheme_ = HttpAuth::AUTH_SCHEME_BASIC;
- score_ = 1;
- properties_ = 0;
+ auth_scheme_ = kBasicSchemeName;
return ParseChallenge(challenge);
}
bool HttpAuthHandlerBasic::ParseChallenge(
HttpAuthChallengeTokenizer* challenge) {
// Verify the challenge's auth-scheme.
- if (!base::LowerCaseEqualsASCII(challenge->scheme(), "basic"))
+ if (!challenge->SchemeIs(kBasicSchemeName))
return false;
std::string realm;
« no previous file with comments | « net/http/http_auth_handler.cc ('k') | net/http/http_auth_handler_digest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698