diff options
author | Henrik Baard <henrik.baard@sonyericsson.com> | 2010-08-16 13:18:10 +0200 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2010-10-17 05:17:11 -0400 |
commit | 0a17f45e0803d4c4e5cfa6b10d8fd265fd5a3a2f (patch) | |
tree | 82ef910082dea60874358fa9cd0fabd806bbe4a8 /core/java/android/webkit | |
parent | 88fa082a47c1d1ddc69f8f490cff34e11192b303 (diff) | |
download | frameworks_base-0a17f45e0803d4c4e5cfa6b10d8fd265fd5a3a2f.zip frameworks_base-0a17f45e0803d4c4e5cfa6b10d8fd265fd5a3a2f.tar.gz frameworks_base-0a17f45e0803d4c4e5cfa6b10d8fd265fd5a3a2f.tar.bz2 |
Error in compound cache-control header.
A cache control header containing both no-cache and max-age attribute does not
behave as expected.
Cache-Control: no-cache, max-age=200000
Will set expired to 20000ms seconds, ignoring the no-cache header. My
interpretation is that the no-cache header should not be ignored in
this case.
Change-Id: Iadd1900e4d2c6c0dacc6bb3e7b944cf78ca9b266
Diffstat (limited to 'core/java/android/webkit')
-rw-r--r-- | core/java/android/webkit/CacheManager.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/webkit/CacheManager.java b/core/java/android/webkit/CacheManager.java index d5058b0..bf1def9 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,8 @@ 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; + } else if (controls[i].startsWith(MAX_AGE) && !noCache) { int separator = controls[i].indexOf('='); if (separator < 0) { separator = controls[i].indexOf(':'); |