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

Unified Diff: net/http/http_auth_handler_basic.cc

Issue 3360017: Fix multi-round authentication.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: SocketStream fix Created 10 years, 3 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_basic.h ('k') | net/http/http_auth_handler_basic_unittest.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
===================================================================
--- net/http/http_auth_handler_basic.cc (revision 59119)
+++ net/http/http_auth_handler_basic.cc (working copy)
@@ -26,21 +26,37 @@
scheme_ = "basic";
score_ = 1;
properties_ = 0;
+ return ParseChallenge(challenge);
+}
+bool HttpAuthHandlerBasic::ParseChallenge(
+ HttpAuth::ChallengeTokenizer* challenge) {
// Verify the challenge's auth-scheme.
if (!challenge->valid() ||
!LowerCaseEqualsASCII(challenge->scheme(), "basic"))
return false;
// Extract the realm (may be missing).
+ std::string realm;
while (challenge->GetNext()) {
if (LowerCaseEqualsASCII(challenge->name(), "realm"))
- realm_ = challenge->unquoted_value();
+ realm = challenge->unquoted_value();
}
- return challenge->valid();
+ if (!challenge->valid())
+ return false;
+
+ realm_ = realm;
+ return true;
}
+HttpAuth::AuthorizationResult HttpAuthHandlerBasic::HandleAnotherChallenge(
+ HttpAuth::ChallengeTokenizer* challenge) {
+ // Basic authentication is always a single round, so any responses should
+ // be treated as a rejection.
+ return HttpAuth::AUTHORIZATION_RESULT_REJECT;
+}
+
int HttpAuthHandlerBasic::GenerateAuthTokenImpl(
const string16* username,
const string16* password,
« no previous file with comments | « net/http/http_auth_handler_basic.h ('k') | net/http/http_auth_handler_basic_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698