diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 17:52:37 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 17:52:37 +0000 |
commit | 6f40bf701483e182ddc9b2375d2a4cbfba0e47cf (patch) | |
tree | eecac7d0548493b01401ad032628f7579543da33 /net/http/http_cache.cc | |
parent | 00c8fcf95d515638a5779a082cff1f4b7fa33631 (diff) | |
download | chromium_src-6f40bf701483e182ddc9b2375d2a4cbfba0e47cf.zip chromium_src-6f40bf701483e182ddc9b2375d2a4cbfba0e47cf.tar.gz chromium_src-6f40bf701483e182ddc9b2375d2a4cbfba0e47cf.tar.bz2 |
Strip embedded "#" in URLs when constructing HTTP cache key.
BUG=http://crbug.com/17493
TEST=HttpCache.UrlContainingHash
Review URL: http://codereview.chromium.org/155972
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache.cc')
-rw-r--r-- | net/http/http_cache.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index bf067db..a45c1ba 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -1470,9 +1470,8 @@ bool HttpCache::WriteResponseInfo(disk_cache::Entry* disk_entry, // Generate a key that can be used inside the cache. std::string HttpCache::GenerateCacheKey(const HttpRequestInfo* request) { - std::string url = request->url.spec(); - if (request->url.has_ref()) - url.erase(url.find_last_of('#')); + // Strip out the reference, username, and password sections of the URL. + std::string url = HttpUtil::SpecForRequest(request->url); DCHECK(mode_ != DISABLE); if (mode_ == NORMAL) { |