Skip to content

Commit

Permalink
appending X-Upstream-Hostname header in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Feb 20, 2018
1 parent b9d410d commit 9a1f722
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/middleware/headers.js
@@ -1,5 +1,7 @@
'use strict';

var os = require('os');

var meta = require('../meta');

module.exports = function (middleware) {
Expand All @@ -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]);
Expand Down

0 comments on commit 9a1f722

Please sign in to comment.