Skip to content

Commit ef86b50

Browse files
committed
Set the x-forwarded-host flag when xfwd is enabled
Reasoning: Rack's request class [makes use of](https://github.com/rack/rack/blob/master/lib/rack/request.rb#L243) this HTTP header. Certain edge-case scenarios (proxying from ember-cli to a Rails backend) can be problematic without this header being present. /cc @perlun, @jesjos
1 parent e1b2f4c commit ef86b50

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/http-proxy/passes/web-incoming.js

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ web_o = Object.keys(web_o).map(function(pass) {
7878
(req.headers['x-forwarded-' + header] ? ',' : '') +
7979
values[header];
8080
});
81+
82+
req.headers['x-forwarded-host'] = req.headers['host'];
8183
},
8284

8385
/**

0 commit comments

Comments
 (0)