@cloud-cli/px 3.4.2 → 3.4.3
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.
- package/README.md +4 -2
- package/dist/proxy.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,8 +83,10 @@ CORS handling on proxy level is convenient, **but a security risk**. Beware:
|
|
|
83
83
|
- All origins are allowed, all common methods and headers, and credentials are enabled.
|
|
84
84
|
- In case of an `OPTIONS` request, if coming via CORS (a preflight), an empty response will be send and the request ends before calling the proxied target.
|
|
85
85
|
|
|
86
|
-
Every request has
|
|
86
|
+
Every request has additional headers:
|
|
87
87
|
|
|
88
88
|
- x-forwarded-for: the host of the original request.
|
|
89
89
|
If a proxy is from 'https://foo.example.com' to 'http://localhost:1234', the header will be 'foo.example.com'
|
|
90
|
-
- x-forwarded-proto: 'http
|
|
90
|
+
- x-forwarded-proto: 'http' or 'https', depends on the original request
|
|
91
|
+
- forwarded: the standard header with the same information as the other two above
|
|
92
|
+
|
package/dist/proxy.js
CHANGED
|
@@ -113,7 +113,7 @@ export class ProxyServer {
|
|
|
113
113
|
proxyRequest.setHeader('host', this.getHost(target));
|
|
114
114
|
proxyRequest.setHeader('x-forwarded-for', req.headers.host);
|
|
115
115
|
proxyRequest.setHeader('x-forwarded-proto', insecure ? 'http' : 'https');
|
|
116
|
-
proxyRequest.setHeader('forwarded', 'host=' + req.headers.host + ';proto=' + insecure ? 'http' : 'https');
|
|
116
|
+
proxyRequest.setHeader('forwarded', 'host=' + req.headers.host + ';proto=' + (insecure ? 'http' : 'https'));
|
|
117
117
|
req.on('data', (chunk) => proxyRequest.write(chunk));
|
|
118
118
|
req.on('end', () => proxyRequest.end());
|
|
119
119
|
proxyRequest.on('error', (error) => this.handleError(error, res));
|