From 17b4f9a87ce73e5f6d87c21c5b593cbd23f797fa Mon Sep 17 00:00:00 2001 From: "jennb@chromium.org" Date: Wed, 2 Dec 2009 01:47:43 +0000 Subject: Ignore URL fragment when looking up URL in application cache. TEST=no new tests; covered by existing layout test BUG=none Review URL: http://codereview.chromium.org/459004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33532 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/appcache/appcache.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'webkit/appcache/appcache.cc') diff --git a/webkit/appcache/appcache.cc b/webkit/appcache/appcache.cc index 6a943c8b..38d3228 100644 --- a/webkit/appcache/appcache.cc +++ b/webkit/appcache/appcache.cc @@ -82,13 +82,22 @@ void AppCache::InitializeWithManifest(Manifest* manifest) { bool AppCache::FindResponseForRequest(const GURL& url, AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, GURL* found_fallback_namespace, bool* found_network_namespace) { - AppCacheEntry* entry = GetEntry(url); + // Ignore fragments when looking up URL in the cache. + GURL url_no_ref; + if (url.has_ref()) { + GURL::Replacements replacements; + replacements.ClearRef(); + url_no_ref = url.ReplaceComponents(replacements); + } else { + url_no_ref = url; + } + AppCacheEntry* entry = GetEntry(url_no_ref); if (entry) { *found_entry = *entry; return true; } - FallbackNamespace* fallback_namespace = FindFallbackNamespace(url); + FallbackNamespace* fallback_namespace = FindFallbackNamespace(url_no_ref); if (fallback_namespace) { entry = GetEntry(fallback_namespace->second); DCHECK(entry); @@ -97,7 +106,7 @@ bool AppCache::FindResponseForRequest(const GURL& url, return true; } - *found_network_namespace = IsInNetworkNamespace(url); + *found_network_namespace = IsInNetworkNamespace(url_no_ref); return *found_network_namespace; } -- cgit v1.1