bdy 1.9.41-dev → 1.9.42-master

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.9.41-dev",
4
+ "version": "1.9.42-master",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -94,6 +94,13 @@ class TunnelHttp extends events_1.default {
94
94
  h += `:${this.port}`;
95
95
  return punycode_js_1.default.toASCII(h);
96
96
  }
97
+ getForwardedHost() {
98
+ if (this.req.headers.host)
99
+ return this.req.headers.host;
100
+ if (this.req.headers[':authority'])
101
+ return this.req.headers[':authority'];
102
+ return 'localhost';
103
+ }
97
104
  getRequestHeaders(http2) {
98
105
  const h = {};
99
106
  let ip;
@@ -116,6 +123,7 @@ class TunnelHttp extends events_1.default {
116
123
  }
117
124
  h['x-forwarded-for'] = ip || '0.0.0.0';
118
125
  h['x-forwarded-proto'] = 'https';
126
+ h['x-forwarded-host'] = this.getForwardedHost();
119
127
  if (this.auth) {
120
128
  h['authorization'] = `Basic ${Buffer.from(this.auth).toString('base64')}`;
121
129
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.9.41-dev",
4
+ "version": "1.9.42-master",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {