Do not set Last-Modifed to January 1st 1970 when cache buster ins layergroup token is 0. In this case, 0 means we don't know when the resource was updated for the last time.

This commit is contained in:
Daniel García Aubert
2019-10-21 11:01:05 +02:00
parent ebff2ac9f2
commit 8ed187b0f5

View File

@@ -10,7 +10,9 @@ module.exports = function setLastModifiedHeader () {
if (cache_buster) {
const cacheBuster = parseInt(cache_buster, 10);
const lastModifiedDate = Number.isFinite(cacheBuster) ? new Date(cacheBuster) : new Date();
const lastModifiedDate = Number.isFinite(cacheBuster) && cacheBuster !== 0
? new Date(cacheBuster)
: new Date();
res.set('Last-Modified', lastModifiedDate.toUTCString());