@lwrjs/dev-proxy-server 0.13.0-alpha.23 → 0.13.0-alpha.25
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/build/cjs/middleware.cjs
CHANGED
|
@@ -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
|
}
|
package/build/es/middleware.js
CHANGED
|
@@ -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.
|
|
7
|
+
"version": "0.13.0-alpha.25",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"build": "tsc -b"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@lwrjs/diagnostics": "0.13.0-alpha.
|
|
37
|
-
"@lwrjs/shared-utils": "0.13.0-alpha.
|
|
36
|
+
"@lwrjs/diagnostics": "0.13.0-alpha.25",
|
|
37
|
+
"@lwrjs/shared-utils": "0.13.0-alpha.25",
|
|
38
38
|
"express": "^4.19.2",
|
|
39
39
|
"http-proxy-middleware": "0.21.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@lwrjs/types": "0.13.0-alpha.
|
|
42
|
+
"@lwrjs/types": "0.13.0-alpha.25"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=18.0.0"
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"volta": {
|
|
48
48
|
"extends": "../../../package.json"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "fe2a578eb76a99cc274ea970c3f24bbc6f15fdba"
|
|
51
51
|
}
|