diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2011-03-29 09:27:16 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-29 09:27:16 -0700 |
commit | f7a9b8691918642db74a667a71028c0a77b527ff (patch) | |
tree | 686f19ffc6efa698927dbdb540c8d98a6acdbfcf /core | |
parent | b618b2ef8722964730d09a86a06a85ca34df6de4 (diff) | |
parent | 1e7fb7aed7b00cebc8f0e501c911727af6527523 (diff) | |
download | frameworks_base-f7a9b8691918642db74a667a71028c0a77b527ff.zip frameworks_base-f7a9b8691918642db74a667a71028c0a77b527ff.tar.gz frameworks_base-f7a9b8691918642db74a667a71028c0a77b527ff.tar.bz2 |
am 1e7fb7ae: Merge "Error in compound cache-control header."
* commit '1e7fb7aed7b00cebc8f0e501c911727af6527523':
Error in compound cache-control header.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/webkit/CacheManager.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/webkit/CacheManager.java b/core/java/android/webkit/CacheManager.java index d171990..eff8e61 100644 --- a/core/java/android/webkit/CacheManager.java +++ b/core/java/android/webkit/CacheManager.java @@ -752,6 +752,7 @@ public final class CacheManager { String cacheControl = headers.getCacheControl(); if (cacheControl != null) { String[] controls = cacheControl.toLowerCase().split("[ ,;]"); + boolean noCache = false; for (int i = 0; i < controls.length; i++) { if (NO_STORE.equals(controls[i])) { return null; @@ -762,7 +763,12 @@ public final class CacheManager { // can only be used in CACHE_MODE_CACHE_ONLY case if (NO_CACHE.equals(controls[i])) { ret.expires = 0; - } else if (controls[i].startsWith(MAX_AGE)) { + noCache = true; + // if cache control = no-cache has been received, ignore max-age + // header, according to http spec: + // If a request includes the no-cache directive, it SHOULD NOT + // include min-fresh, max-stale, or max-age. + } else if (controls[i].startsWith(MAX_AGE) && !noCache) { int separator = controls[i].indexOf('='); if (separator < 0) { separator = controls[i].indexOf(':'); |