diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 16:21:40 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 16:21:40 +0000 |
commit | 9001c8ca3fa4ccd1dee1c54dbedf3e2619179f11 (patch) | |
tree | ba3e20bc47a210d60a16afb38f38bc775274db86 /net/socket_stream | |
parent | dc7364f1c2f0c9fa29c5dad211892f45e31c9b6e (diff) | |
download | chromium_src-9001c8ca3fa4ccd1dee1c54dbedf3e2619179f11.zip chromium_src-9001c8ca3fa4ccd1dee1c54dbedf3e2619179f11.tar.gz chromium_src-9001c8ca3fa4ccd1dee1c54dbedf3e2619179f11.tar.bz2 |
Added authentication scheme as key to HttpAuthCache.
Behavioral changes are small; this is mostly a syntactic sugar change. But
there are a few behavioral changes:
* If a web site replies with different schemes for the same realm, we'll have two entries in the cache.
* There will not be a log entry in HttpNetworkTransaction::SelectNextAuthIdentityToTry when we have the wrong authentication scheme (we don't see that entry any more)
* We will no longer return ERR_TUNNEL_CONNECTION_FAILED from SocketStream::HandleAuthChallenge when there's an entry in the cache with a non-basic authentication scheme (we won't know it's there).
Contributed by rdsmith@chromium.org
BUG=33433
TEST=HttpAuthCacheTest.* (as modified in this commit), HttpNetworkTransactionTest.*, SocketStreamTest.*, only on Linux.
Review URL: http://codereview.chromium.org/1949004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket_stream')
-rw-r--r-- | net/socket_stream/socket_stream.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc index b957d8a..68fbbf3 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(); |