@cloud-cli/px 4.1.2 → 4.1.4

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.
@@ -22,7 +22,6 @@ const emptyProxy = {
22
22
  target: '',
23
23
  cors: false,
24
24
  redirect: false,
25
- preserveHost: false,
26
25
  redirectUrl: '',
27
26
  headers: '',
28
27
  authorization: '',
@@ -42,7 +41,7 @@ const readOption = value => {
42
41
  }
43
42
  };
44
43
  function applyProperties(proxy, options) {
45
- const properties = ['target', 'cors', 'redirect', 'redirectUrl', 'headers', 'authorization', 'preserveHost'];
44
+ const properties = ['target', 'cors', 'redirect', 'redirectUrl', 'headers', 'authorization'];
46
45
  properties.forEach((p) => {
47
46
  if (p in options) {
48
47
  proxy[p] = readOption(options[p]);
@@ -69,10 +68,13 @@ export class ProxyManager {
69
68
  }
70
69
  async updateProxy(options) {
71
70
  readDomain(options);
72
- const host = options.domain;
73
- let proxy = get(host);
71
+ const domain = options.domain;
72
+ let proxy = get(domain);
73
+ if (!domain) {
74
+ throw domainNotSpecifiedError;
75
+ }
74
76
  if (!proxy) {
75
- proxy = { ...emptyProxy, domain: host };
77
+ proxy = { ...emptyProxy, domain };
76
78
  }
77
79
  applyProperties(proxy, options);
78
80
  set(proxy.domain, proxy);
package/dist/types.d.ts CHANGED
@@ -16,7 +16,6 @@ export interface Proxy {
16
16
  headers: string;
17
17
  authorization: string;
18
18
  cors: boolean;
19
- preserveHost: boolean;
20
19
  }
21
20
  export type WithOptionalProps<T extends object> = T & OptionalProps;
22
21
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-cli/px",
3
- "version": "4.1.2",
3
+ "version": "4.1.4",
4
4
  "description": "Reverse Proxy",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",