mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 17:54:33 +03:00
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:
parent
9742a8317f
commit
d196dee05b
@ -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++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user