llcache: Use last_modified instead of date

When sending an If-Modified-Since header we should use the
`last_modified` rather than the `date` property of the cached
object in order to not incorrectly assume things have a modification
date when they do not.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-08-02 12:22:30 +01:00
parent 9742a8317f
commit d196dee05b
1 changed files with 2 additions and 2 deletions

View File

@ -860,7 +860,7 @@ static nserror llcache_object_refetch(llcache_object *object)
header_idx++;
}
if (object->cache.date != 0) {
if (object->cache.last_modified != 0) {
/* Maximum length of an RFC 1123 date is 29 bytes */
const size_t len = SLEN("If-Modified-Since: ") + 29 + 1;
@ -873,7 +873,7 @@ static nserror llcache_object_refetch(llcache_object *object)
}
snprintf(headers[header_idx], len, "If-Modified-Since: %s",
rfc1123_date(object->cache.date));
rfc1123_date(object->cache.last_modified));
header_idx++;
}