@cloud-cli/px 3.5.7 → 3.6.0

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/dist/index.js CHANGED
@@ -13,7 +13,7 @@ const manager = new ProxyManager();
13
13
  async function reload() {
14
14
  const targets = await loadTargets();
15
15
  px.reset();
16
- targets.forEach(t => {
16
+ targets.forEach((t) => {
17
17
  px.add(new ProxyEntry({
18
18
  domain: t.domain,
19
19
  target: t.target,
@@ -21,6 +21,7 @@ async function reload() {
21
21
  redirectToHttps: t.redirect,
22
22
  redirectToUrl: t.redirectUrl,
23
23
  cors: t.cors,
24
+ headers: t.headers,
24
25
  }));
25
26
  });
26
27
  px.start();
@@ -19,6 +19,7 @@ export class ProxyManager {
19
19
  cors: !!proxy.cors,
20
20
  redirect: !!proxy.redirect,
21
21
  redirectUrl: proxy.redirectUrl || '',
22
+ headers: proxy.headers || '',
22
23
  });
23
24
  try {
24
25
  const id = await entry.save();
@@ -37,8 +38,9 @@ export class ProxyManager {
37
38
  const [domain, path = ''] = host.split('/');
38
39
  proxies.push(new Proxy({ domain, path }));
39
40
  }
41
+ const properties = ['target', 'cors', 'redirect', 'redirectUrl', 'headers'];
40
42
  for (const proxy of proxies) {
41
- ['target', 'cors', 'redirect', 'redirectUrl'].forEach((p) => p in options && (proxy[p] = options[p]));
43
+ properties.forEach((p) => p in options && (proxy[p] = options[p]));
42
44
  await proxy.save();
43
45
  }
44
46
  return true;
package/dist/proxy.d.ts CHANGED
@@ -6,6 +6,7 @@ export declare class Proxy extends Resource {
6
6
  target: string;
7
7
  redirect: boolean;
8
8
  redirectUrl: string;
9
+ headers: string;
9
10
  cors: boolean;
10
11
  constructor(p: Partial<Proxy>);
11
12
  }
package/dist/proxy.js CHANGED
@@ -29,6 +29,9 @@ __decorate([
29
29
  __decorate([
30
30
  Property(String)
31
31
  ], Proxy.prototype, "redirectUrl", void 0);
32
+ __decorate([
33
+ Property(String)
34
+ ], Proxy.prototype, "headers", void 0);
32
35
  __decorate([
33
36
  Property(Number)
34
37
  ], Proxy.prototype, "cors", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-cli/px",
3
- "version": "3.5.7",
3
+ "version": "3.6.0",
4
4
  "description": "Reverse Proxy",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",