@lwrjs/dev-proxy-server 0.16.2 → 0.16.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/build/cjs/middleware.cjs +0 -7
- package/build/es/middleware.js +0 -11
- package/package.json +5 -5
package/build/cjs/middleware.cjs
CHANGED
|
@@ -109,13 +109,6 @@ function addRemoteProxyMiddleware(app, proxyConfig) {
|
|
|
109
109
|
proxyRequest.path = originalPath;
|
|
110
110
|
if (process.env.AUTH_TOKEN) {
|
|
111
111
|
addAuthCookie(proxyRequest, process.env.AUTH_TOKEN);
|
|
112
|
-
if (process.env.PROXY_AS_GUEST !== "true") {
|
|
113
|
-
const reqUrl = new URL(incomingRequest.url || "", `http://${incomingRequest.headers.host}`);
|
|
114
|
-
if (reqUrl.searchParams.get("asGuest") === "true") {
|
|
115
|
-
reqUrl.searchParams.set("asGuest", "false");
|
|
116
|
-
proxyRequest.path = reqUrl.pathname + reqUrl.search;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
112
|
}
|
|
120
113
|
}
|
|
121
114
|
}));
|
package/build/es/middleware.js
CHANGED
|
@@ -154,17 +154,6 @@ export function addRemoteProxyMiddleware(app, proxyConfig) {
|
|
|
154
154
|
// Retrieve the current cookie header
|
|
155
155
|
if (process.env.AUTH_TOKEN) {
|
|
156
156
|
addAuthCookie(proxyRequest, process.env.AUTH_TOKEN);
|
|
157
|
-
// TODO once local-dev bundles are updated appropriately we can remove this
|
|
158
|
-
// Remove asGuest from query parameters as that can cause issues with certain requests
|
|
159
|
-
// Example Request for CMS image that fails with asGuest=true
|
|
160
|
-
// /services/data/v62.0/connect/sites/0DMSB000000jBc24AE/cms/delivery/contents?includeContentBody=true&contentKeys=MCB6JD6GWNRVFYHN2CAP5WQNOXQE&language=en-US&asGuest=true&htmlEncode=false
|
|
161
|
-
if (process.env.PROXY_AS_GUEST !== 'true') {
|
|
162
|
-
const reqUrl = new URL(incomingRequest.url || '', `http://${incomingRequest.headers.host}`);
|
|
163
|
-
if (reqUrl.searchParams.get('asGuest') === 'true') {
|
|
164
|
-
reqUrl.searchParams.set('asGuest', 'false');
|
|
165
|
-
proxyRequest.path = reqUrl.pathname + reqUrl.search;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
157
|
}
|
|
169
158
|
},
|
|
170
159
|
}));
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.16.
|
|
7
|
+
"version": "0.16.3",
|
|
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.16.
|
|
37
|
-
"@lwrjs/shared-utils": "0.16.
|
|
36
|
+
"@lwrjs/diagnostics": "0.16.3",
|
|
37
|
+
"@lwrjs/shared-utils": "0.16.3",
|
|
38
38
|
"express": "^4.20.0",
|
|
39
39
|
"http-proxy-middleware": "2.0.7"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@lwrjs/types": "0.16.
|
|
42
|
+
"@lwrjs/types": "0.16.3"
|
|
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": "91bc46c88ff7201851f02fc4a3d38d39e81885c6"
|
|
51
51
|
}
|