From d196dee05b8dc5245da32629bc8f7759cf55a62a Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 2 Aug 2019 12:22:30 +0100 Subject: 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 --- content/llcache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/llcache.c b/content/llcache.c index 625e810ff..ff21d29ab 100644 --- a/content/llcache.c +++ b/content/llcache.c @@ -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++; } -- cgit v1.2.3