Extract sendResponse middleware from context
This commit is contained in:
parent
a5c508733a
commit
091efe52fc
@ -60,7 +60,7 @@ NamedMapsController.prototype.register = function(app) {
|
||||
setLastModifiedHeader(),
|
||||
setCacheControlHeader(),
|
||||
setContentTypeHeader(),
|
||||
this.respond(),
|
||||
sendResponse(),
|
||||
vectorError()
|
||||
);
|
||||
|
||||
@ -89,7 +89,7 @@ NamedMapsController.prototype.register = function(app) {
|
||||
setLastModifiedHeader(),
|
||||
setCacheControlHeader(),
|
||||
setContentTypeHeader(),
|
||||
this.respond()
|
||||
sendResponse()
|
||||
);
|
||||
};
|
||||
|
||||
@ -490,8 +490,8 @@ function setContentTypeHeader () {
|
||||
};
|
||||
}
|
||||
|
||||
NamedMapsController.prototype.respond = function () {
|
||||
return function respondMiddleware (req, res) {
|
||||
function sendResponse () {
|
||||
return function sendResponseMiddleware (req, res) {
|
||||
const { body, stats = {}, format } = res.locals;
|
||||
|
||||
req.profiler.done('render-' + format);
|
||||
@ -500,4 +500,4 @@ NamedMapsController.prototype.respond = function () {
|
||||
res.status(200);
|
||||
res.send(body);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user