As http header can't be empty, check length before

setting lastModified and etag to the cacheResult.

Fix http://b/issue?id=2531047
This commit is contained in:
Grace Kloba
2010-03-19 19:48:28 -07:00
parent ee8500eeb0
commit 7865fa9724

View File

@@ -733,11 +733,15 @@ public final class CacheManager {
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) {