Remove parameter now for last-modified-header

This commit is contained in:
Daniel García Aubert
2018-07-10 13:22:38 +02:00
parent 10d21a4a0f
commit 4f81f402f5
3 changed files with 3 additions and 10 deletions
@@ -96,7 +96,7 @@ module.exports = class AnonymousMapController {
cacheControlHeader({ ttl: global.environment.varnish.layergroupTtl || 86400, revalidate: true }),
cacheChannelHeader(),
surrogateKeyHeader({ surrogateKeysCache: this.surrogateKeysCache }),
lastModifiedHeader({ now: true }),
lastModifiedHeader(),
lastUpdatedTimeLayergroup(),
layerStats(this.pgConnection, this.statsBackend),
layergroupIdHeader(this.templateMaps, useTemplateHash),
@@ -1,4 +1,4 @@
module.exports = function setLastModifiedHeader ({ now = false } = {}) {
module.exports = function setLastModifiedHeader () {
return function setLastModifiedHeaderMiddleware(req, res, next) {
if (req.method !== 'GET') {
return next();
@@ -15,13 +15,6 @@ module.exports = function setLastModifiedHeader ({ now = false } = {}) {
return next();
}
// REVIEW: to keep 100% compatibility with maps controller
if (now) {
res.set('Last-Modified', new Date().toUTCString());
return next();
}
mapConfigProvider.getAffectedTables((err, affectedTables) => {
if (err) {
global.logger.warn('ERROR generating Last Modified Header:', err);
@@ -101,7 +101,7 @@ module.exports = class NamedMapController {
cacheControlHeader({ ttl: global.environment.varnish.layergroupTtl || 86400, revalidate: true }),
cacheChannelHeader(),
surrogateKeyHeader({ surrogateKeysCache: this.surrogateKeysCache }),
lastModifiedHeader({ now: true }),
lastModifiedHeader(),
lastUpdatedTimeLayergroup(),
layerStats(this.pgConnection, this.statsBackend),
layergroupIdHeader(this.templateMaps ,useTemplateHash),