Windshaft-cartodb/lib/api/middlewares/served-by-host-header.js
2019-10-07 09:40:50 +02:00

14 lines
285 B
JavaScript

'use strict';
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();
};
};