As http header can't be empty, check length before
setting lastModified and etag to the cacheResult.
Fix http://b/issue?id=2531047
diff --git a/core/java/android/webkit/CacheManager.java b/core/java/android/webkit/CacheManager.java
index 1c59c10..4f680e5 100644
--- a/core/java/android/webkit/CacheManager.java
+++ b/core/java/android/webkit/CacheManager.java
@@ -733,11 +733,15 @@
ret.contentdisposition = contentDisposition;
}
+ // lastModified and etag may be set back to http header. So they can't
+ // be empty string.
String lastModified = headers.getLastModified();
- if (lastModified != null) ret.lastModified = lastModified;
+ if (lastModified != null && lastModified.length() > 0) {
+ ret.lastModified = lastModified;
+ }
String etag = headers.getEtag();
- if (etag != null) ret.etag = etag;
+ if (etag != null && etag.length() > 0) ret.etag = etag;
String cacheControl = headers.getCacheControl();
if (cacheControl != null) {