Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7865fa97 authored by Grace Kloba's avatar Grace Kloba
Browse files

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

setting lastModified and etag to the cacheResult.

Fix http://b/issue?id=2531047
parent ee8500ee
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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) {