diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-10 01:27:48 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-10 01:27:48 +0000 |
commit | cb0d6bd52ea9b586f51efb97e4bcd47a458e8da8 (patch) | |
tree | 8a40709d672ed57b3d78b74c775c14cfc17ab629 /webkit/appcache/appcache_request_handler.cc | |
parent | 2800af3895526be12deb6383c62fabf9d00dfc2f (diff) | |
download | chromium_src-cb0d6bd52ea9b586f51efb97e4bcd47a458e8da8.zip chromium_src-cb0d6bd52ea9b586f51efb97e4bcd47a458e8da8.tar.gz chromium_src-cb0d6bd52ea9b586f51efb97e4bcd47a458e8da8.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84734 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_request_handler.cc')
-rw-r--r-- | webkit/appcache/appcache_request_handler.cc | 10 |
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 |