Do not add x-profiler header as it's already added by sendResponse

This commit is contained in:
Raul Ochoa 2015-04-14 16:41:04 +02:00
parent 1bf2809355
commit 84f579f0ec

View File

@ -59,9 +59,6 @@ TemplateMapsController.prototype.create = function(req, res) {
return { template_id: cdbuser + '@' + tpl_id };
},
function finish(err, response){
if ( req.profiler ) {
res.header('X-Tiler-Profiler', req.profiler.toJSONString());
}
if (err){
response = { error: ''+err };
var statusCode = 400;
@ -115,9 +112,6 @@ TemplateMapsController.prototype.update = function(req, res) {
return { template_id: cdbuser + '@' + tpl_id };
},
function finish(err, response){
if ( req.profiler ) {
res.header('X-Tiler-Profiler', req.profiler.toJSONString());
}
if (err){
var statusCode = 400;
response = { error: ''+err };
@ -304,7 +298,7 @@ TemplateMapsController.prototype.instantiate = function(req, res) {
}
self.instantiateTemplate(req, res, req.body, this);
}, function(err, response) {
self.finish_instantiation(err, response, res, req);
self.finish_instantiation(err, response, res);
}
);
};
@ -339,7 +333,7 @@ TemplateMapsController.prototype.jsonp = function(req, res) {
}
self.instantiateTemplate(req, res, config, this);
}, function(err, response) {
self.finish_instantiation(err, response, res, req);
self.finish_instantiation(err, response, res);
}
);
};
@ -446,10 +440,7 @@ TemplateMapsController.prototype.instantiateTemplate = function(req, res, templa
);
};
TemplateMapsController.prototype.finish_instantiation = function(err, response, res, req) {
if ( req.profiler ) {
res.header('X-Tiler-Profiler', req.profiler.toJSONString());
}
TemplateMapsController.prototype.finish_instantiation = function(err, response, res) {
if (err) {
var statusCode = 400;
response = { error: ''+err };