Extarct setCacheChannelHeader middleware from controller's context

This commit is contained in:
Daniel García Aubert
2018-03-14 13:19:56 +01:00
parent 2d4ce19250
commit 3dbe05be3a
+4 -4
View File
@@ -56,7 +56,7 @@ NamedMapsController.prototype.register = function(app) {
getAffectedTables(),
getTile(tileOptions),
this.setSurrogateKey(),
this.setCacheChannelHeader(),
setCacheChannelHeader(),
this.setLastModifiedHeader(),
this.setCacheControlHeader(),
this.setContentTypeHeader(),
@@ -85,7 +85,7 @@ NamedMapsController.prototype.register = function(app) {
getImage(staticOptions),
incrementMapViews({ metadataBackend: this.metadataBackend }),
this.setSurrogateKey(),
this.setCacheChannelHeader(),
setCacheChannelHeader(),
this.setLastModifiedHeader(),
this.setCacheControlHeader(),
this.setContentTypeHeader(),
@@ -419,7 +419,7 @@ function templateBounds(view) {
return false;
}
NamedMapsController.prototype.setCacheChannelHeader = function () {
function setCacheChannelHeader () {
return function setCacheChannelHeaderMiddleware (req, res, next) {
const { affectedTablesAndLastUpdate } = res.locals;
@@ -429,7 +429,7 @@ NamedMapsController.prototype.setCacheChannelHeader = function () {
next();
};
};
}
NamedMapsController.prototype.setSurrogateKey = function () {
return function setSurrogateKeyMiddleware(req, res, next) {