appending X-Upstream-Hostname header in dev mode

v1.18.x
Julian Lam 7 years ago
parent b9d410d612
commit 9a1f722a05

@ -1,5 +1,7 @@
'use strict';
var os = require('os');
var meta = require('../meta');
module.exports = function (middleware) {
@ -15,6 +17,10 @@ module.exports = function (middleware) {
headers['Access-Control-Allow-Origin'] = encodeURI(meta.config['access-control-allow-origin']);
}
if (process.env.NODE_ENV === 'development') {
headers['X-Upstream-Hostname'] = os.hostname();
}
for (var key in headers) {
if (headers.hasOwnProperty(key) && headers[key]) {
res.setHeader(key, headers[key]);

Loading…
Cancel
Save