Windshaft-cartodb/lib/cartodb/api/middlewares/served-by-host-header.js
2018-04-09 16:18:30 +02:00

12 lines
270 B
JavaScript

const os = require('os');
module.exports = function servedByHostHeader () {
const hostname = os.hostname().split('.')[0];
return function servedByHostHeaderMiddleware (req, res, next) {
res.set('X-Served-By-Host', hostname);
next();
};
};