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

Unified Diff: net/socket_stream/socket_stream.cc

Issue 1949004: Added authentication scheme as key to HttpAuthCache. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Fixed nits from eroman. Created 10 years, 7 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_network_transaction.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket_stream/socket_stream.cc
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index b957d8ad71a4091efe52fa2596b175d54c631655..68fbbf34b6a887e0bbc88961e74e8cbc9d7fb003 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -862,6 +862,7 @@ int SocketStream::HandleAuthChallenge(const HttpResponseHeaders* headers) {
if (auth_identity_.source != HttpAuth::IDENT_SRC_PATH_LOOKUP)
auth_cache_.Remove(auth_origin,
auth_handler_->realm(),
+ auth_handler_->scheme(),
auth_identity_.username,
auth_identity_.password);
auth_handler_ = NULL;
@@ -877,14 +878,11 @@ int SocketStream::HandleAuthChallenge(const HttpResponseHeaders* headers) {
return ERR_TUNNEL_CONNECTION_FAILED;
}
if (auth_handler_->NeedsIdentity()) {
- HttpAuthCache::Entry* entry = auth_cache_.LookupByRealm(
- auth_origin, auth_handler_->realm());
+ // We only support basic authentication scheme now.
+ // TODO(ukai): Support other authentication scheme.
+ HttpAuthCache::Entry* entry =
+ auth_cache_.Lookup(auth_origin, auth_handler_->realm(), "basic");
if (entry) {
- if (entry->handler()->scheme() != "basic") {
- // We only support basic authentication scheme now.
- // TODO(ukai): Support other authentication scheme.
- return ERR_TUNNEL_CONNECTION_FAILED;
- }
auth_identity_.source = HttpAuth::IDENT_SRC_REALM_LOOKUP;
auth_identity_.invalid = false;
auth_identity_.username = entry->username();
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698