@lwrjs/dev-proxy-server 0.13.0-alpha.9 → 0.13.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.
@@ -67,12 +67,16 @@ function addRemoteProxyMiddleware(app, proxyConfig) {
67
67
  },
68
68
  followRedirects: false,
69
69
  changeOrigin: true,
70
+ autoRewrite: false,
71
+ ignorePath: false,
70
72
  onProxyReq: (proxyRequest, incomingRequest) => {
71
73
  const hostHeader = incomingRequest.headers.host;
72
74
  if (hostHeader !== target) {
73
75
  proxyRequest.setHeader(HOST, targetHost);
74
76
  }
75
77
  proxyRequest.setHeader("Forwarded", `host=${hostHeader}`);
78
+ const originalPath = incomingRequest.url;
79
+ proxyRequest.path = originalPath;
76
80
  }
77
81
  }));
78
82
  }
@@ -1,4 +1,4 @@
1
- import type { LwrProxyServerConfig, ProxyConfiguration } from './proxy-server';
1
+ import type { LwrProxyServerConfig, ProxyConfiguration } from './proxy-server.js';
2
2
  import { LwrProxyServer } from './proxy-server.js';
3
3
  export declare const DEFAULT_PROXY_PORT = 4000;
4
4
  /**
@@ -54,6 +54,8 @@ export function addRemoteProxyMiddleware(app, proxyConfig) {
54
54
  },
55
55
  followRedirects: false,
56
56
  changeOrigin: true,
57
+ autoRewrite: false,
58
+ ignorePath: false,
57
59
  onProxyReq: (proxyRequest, incomingRequest) => {
58
60
  // Fix up any Host header. We ignore any current value and
59
61
  // always replace it with the target host.
@@ -64,6 +66,9 @@ export function addRemoteProxyMiddleware(app, proxyConfig) {
64
66
  }
65
67
  // Add Forwarded header per https://git.soma.salesforce.com/pages/benjamin-fry/lwr-on-mrt-designs/request_path.html
66
68
  proxyRequest.setHeader('Forwarded', `host=${hostHeader}`);
69
+ // Preserve the original path, including double slashes
70
+ const originalPath = incomingRequest.url;
71
+ proxyRequest.path = originalPath;
67
72
  },
68
73
  }));
69
74
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.13.0-alpha.9",
7
+ "version": "0.13.0",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -29,14 +29,17 @@
29
29
  "build/**/*.cjs",
30
30
  "build/**/*.d.ts"
31
31
  ],
32
+ "scripts": {
33
+ "build": "tsc -b"
34
+ },
32
35
  "dependencies": {
33
- "@lwrjs/diagnostics": "0.13.0-alpha.9",
34
- "@lwrjs/shared-utils": "0.13.0-alpha.9",
36
+ "@lwrjs/diagnostics": "0.13.0",
37
+ "@lwrjs/shared-utils": "0.13.0",
35
38
  "express": "^4.19.2",
36
39
  "http-proxy-middleware": "0.21.0"
37
40
  },
38
41
  "devDependencies": {
39
- "@lwrjs/types": "0.13.0-alpha.9"
42
+ "@lwrjs/types": "0.13.0"
40
43
  },
41
44
  "engines": {
42
45
  "node": ">=18.0.0"
@@ -44,5 +47,5 @@
44
47
  "volta": {
45
48
  "extends": "../../../package.json"
46
49
  },
47
- "gitHead": "a2a9e1dbf39a7b04c7a43433e004895b6f4c51a3"
50
+ "gitHead": "21dc6b8ffd2e633f36b46daf9e1563992c5143b9"
48
51
  }