summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_request_handler.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 18:18:30 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 18:18:30 +0000
commit6a22f4f49dea0d632319da665482cf925785b19b (patch)
tree367c73d75f77a5550f4450acf1c725eecc51f36a /webkit/appcache/appcache_request_handler.cc
parent513fe6b24ab0daa514c1c86793c9c49086c92be5 (diff)
downloadchromium_src-6a22f4f49dea0d632319da665482cf925785b19b.zip
chromium_src-6a22f4f49dea0d632319da665482cf925785b19b.tar.gz
chromium_src-6a22f4f49dea0d632319da665482cf925785b19b.tar.bz2
Merge 84734 - AppCache fallback override. A means of overriding the fallback behavior from the server-side by adding a particular response header. Error responses containing the header/value pair will not trigger the fallback behavior.
x-chromium-appcache-fallback-override: disallow-fallback BUG=82066 TEST=appcache_request_handler_unittest.cc Review URL: http://codereview.chromium.org/6969006 TBR=michaeln@google.com Review URL: http://codereview.chromium.org/7005001 git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@84818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_request_handler.cc')
-rw-r--r--webkit/appcache/appcache_request_handler.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/webkit/appcache/appcache_request_handler.cc b/webkit/appcache/appcache_request_handler.cc
index 064b378..a90d6d7 100644
--- a/webkit/appcache/appcache_request_handler.cc
+++ b/webkit/appcache/appcache_request_handler.cc
@@ -137,6 +137,16 @@ AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse(
int code_major = request->GetResponseCode() / 100;
if (code_major !=4 && code_major != 5)
return NULL;
+
+ // Servers can override the fallback behavior with a response header.
+ const std::string kFallbackOverrideHeader(
+ "x-chromium-appcache-fallback-override");
+ const std::string kFallbackOverrideValue(
+ "disallow-fallback");
+ std::string header_value;
+ request->GetResponseHeaderByName(kFallbackOverrideHeader, &header_value);
+ if (header_value == kFallbackOverrideValue)
+ return NULL;
}
// 6.9.6, step 4: If this results in a 4xx or 5xx status code