diff options
author | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 14:47:51 +0000 |
---|---|---|
committer | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 14:47:51 +0000 |
commit | 655712ac0c0effdfc36113d5dc7144816142f57c (patch) | |
tree | 01c1fc88f2571dcc668f56f74e1fbc265a735374 /net/http/http_auth_cache.h | |
parent | e8b139ff59a512af71003c2300ee1230235e9a52 (diff) | |
download | chromium_src-655712ac0c0effdfc36113d5dc7144816142f57c.zip chromium_src-655712ac0c0effdfc36113d5dc7144816142f57c.tar.gz chromium_src-655712ac0c0effdfc36113d5dc7144816142f57c.tar.bz2 |
Pick the closest enclosing path match when looking up HTTP auth cache entries by path
If we have two cache entries :
< 'example.com', userA, realmA, paths=[ '/' ] > and
< 'example.com', userB, realmB, paths=[ '/foo/' ] >
Then a LookupByPath() for '/foo/bar/baz' should return the cache entry for userB rather than userA.
BUG=73294
TEST=net_unittests --gtest_filter=HttpAuthCacheTest.Basic
Review URL: http://codereview.chromium.org/6596076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76539 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_cache.h')
-rw-r--r-- | net/http/http_auth_cache.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h index a130956..2895401 100644 --- a/net/http/http_auth_cache.h +++ b/net/http/http_auth_cache.h @@ -160,8 +160,11 @@ class HttpAuthCache::Entry { // already contained in the protection space, is a no-op. void AddPath(const std::string& path); - // Returns true if |dir| is contained within the realm's protection space. - bool HasEnclosingPath(const std::string& dir); + // Returns true if |dir| is contained within the realm's protection + // space. |*path_len| is set to the length of the enclosing path if + // such a path exists and |path_len| is non-NULL. If no enclosing + // path is found, |path_len| is left unmodified. + bool HasEnclosingPath(const std::string& dir, size_t* path_len); // |origin_| contains the {protocol, host, port} of the server. GURL origin_; |