@sitecore-jss/sitecore-jss-proxy 21.1.1 → 21.2.0-canary.1
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/README.md +5 -3
- package/dist/cjs/index.js +4 -2
- package/dist/esm/index.js +4 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
This module is provided as a part of Sitecore JavaScript Rendering SDK (JSS). It contains the headless-mode SSR proxy implementation.
|
|
4
4
|
|
|
5
|
+
<!---
|
|
6
|
+
@TODO: Update to version 20.0.0 docs before release
|
|
7
|
+
-->
|
|
8
|
+
[Documentation](https://doc.sitecore.com/xp/en/developers/hd/190/sitecore-headless-development/server-side-render-jss-apps-headlessly-using-the-jss-proxy.html)
|
|
5
9
|
|
|
6
|
-
[
|
|
7
|
-
|
|
8
|
-
[API reference documentation](/ref-docs/sitecore-jss-proxy/)
|
|
10
|
+
[API reference documentation](/ref-docs/sitecore-jss-proxy/).
|
package/dist/cjs/index.js
CHANGED
|
@@ -286,9 +286,11 @@ function rewriteRequestPath(reqPath, req, config, parseRouteUrl) {
|
|
|
286
286
|
let finalReqPath = decodedReqPath;
|
|
287
287
|
const qsIndex = finalReqPath.indexOf('?');
|
|
288
288
|
let qs = '';
|
|
289
|
-
if (qsIndex > -1) {
|
|
289
|
+
if (qsIndex > -1 || Object.keys(req.query).length) {
|
|
290
290
|
qs = (0, util_1.buildQueryString)(req.query);
|
|
291
|
-
|
|
291
|
+
// Splice qs part when url contains that
|
|
292
|
+
if (qsIndex > -1)
|
|
293
|
+
finalReqPath = finalReqPath.slice(0, qsIndex);
|
|
292
294
|
}
|
|
293
295
|
if (config.qsParams) {
|
|
294
296
|
if (qs) {
|
package/dist/esm/index.js
CHANGED
|
@@ -279,9 +279,11 @@ export function rewriteRequestPath(reqPath, req, config, parseRouteUrl) {
|
|
|
279
279
|
let finalReqPath = decodedReqPath;
|
|
280
280
|
const qsIndex = finalReqPath.indexOf('?');
|
|
281
281
|
let qs = '';
|
|
282
|
-
if (qsIndex > -1) {
|
|
282
|
+
if (qsIndex > -1 || Object.keys(req.query).length) {
|
|
283
283
|
qs = buildQueryString(req.query);
|
|
284
|
-
|
|
284
|
+
// Splice qs part when url contains that
|
|
285
|
+
if (qsIndex > -1)
|
|
286
|
+
finalReqPath = finalReqPath.slice(0, qsIndex);
|
|
285
287
|
}
|
|
286
288
|
if (config.qsParams) {
|
|
287
289
|
if (qs) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-proxy",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.2.0-canary.1",
|
|
4
4
|
"description": "Proxy middleware for express.js server.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typescript": "~4.9.5"
|
|
48
48
|
},
|
|
49
49
|
"types": "types/index.d.ts",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "dc42835a8d9241ab050938f45c795a795a1a190a",
|
|
51
51
|
"files": [
|
|
52
52
|
"dist",
|
|
53
53
|
"types"
|