@lwrjs/core 0.15.4 → 0.15.6

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.
@@ -142,15 +142,17 @@ function createViewMiddleware(route, errorRoutes, context, viewHandler) {
142
142
  } else if (viewDefinitionStatus && viewDefinitionStatus.code) {
143
143
  const origStatus = status;
144
144
  const {code, location} = viewDefinitionStatus;
145
- const isRedirect = code === 301 || code == 302;
145
+ const isRedirect = code === 301 || code === 302;
146
146
  status = code;
147
- if (isRedirect && location && (0, import_shared_utils.isURL)(location) || location?.startsWith("/")) {
148
- res.set({
149
- location: addRedirectQueryParam(location, (0, import_shared_utils.parseRequestDepth)(req.headers, req.query))
150
- });
151
- } else {
152
- status = origStatus;
153
- import_diagnostics.logger.warn(`[view-middleware] Ignoring invalid location header: "${location}"`);
147
+ if (isRedirect) {
148
+ if (location && (0, import_shared_utils.isURL)(location) || location?.startsWith("/")) {
149
+ res.set({
150
+ location: addRedirectQueryParam(location, (0, import_shared_utils.parseRequestDepth)(req.headers, req.query))
151
+ });
152
+ } else {
153
+ status = origStatus;
154
+ import_diagnostics.logger.warn(`[view-middleware] Ignoring invalid location header: "${location}"`);
155
+ }
154
156
  }
155
157
  }
156
158
  res.status(status);
@@ -127,17 +127,19 @@ function createViewMiddleware(route, errorRoutes, context, viewHandler) {
127
127
  else if (viewDefinitionStatus && viewDefinitionStatus.code) {
128
128
  const origStatus = status;
129
129
  const { code, location } = viewDefinitionStatus;
130
- const isRedirect = code === 301 || code == 302;
130
+ const isRedirect = code === 301 || code === 302;
131
131
  status = code;
132
- if ((isRedirect && location && isURL(location)) || location?.startsWith('/')) {
133
- res.set({
134
- location: addRedirectQueryParam(location, parseRequestDepth(req.headers, req.query)),
135
- });
136
- }
137
- else {
138
- // reset the status in the event of an ivalid location when redirecting
139
- status = origStatus;
140
- logger.warn(`[view-middleware] Ignoring invalid location header: "${location}"`);
132
+ if (isRedirect) {
133
+ if ((location && isURL(location)) || location?.startsWith('/')) {
134
+ res.set({
135
+ location: addRedirectQueryParam(location, parseRequestDepth(req.headers, req.query)),
136
+ });
137
+ }
138
+ else {
139
+ // reset the status in the event of an invalid location when redirecting
140
+ status = origStatus;
141
+ logger.warn(`[view-middleware] Ignoring invalid location header: "${location}"`);
142
+ }
141
143
  }
142
144
  }
143
145
  res.status(status);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.15.4",
7
+ "version": "0.15.6",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -43,34 +43,34 @@
43
43
  "build": "tsc -b"
44
44
  },
45
45
  "dependencies": {
46
- "@lwrjs/app-service": "0.15.4",
47
- "@lwrjs/asset-registry": "0.15.4",
48
- "@lwrjs/asset-transformer": "0.15.4",
49
- "@lwrjs/base-view-provider": "0.15.4",
50
- "@lwrjs/base-view-transformer": "0.15.4",
51
- "@lwrjs/client-modules": "0.15.4",
52
- "@lwrjs/config": "0.15.4",
53
- "@lwrjs/diagnostics": "0.15.4",
54
- "@lwrjs/esbuild": "0.15.4",
55
- "@lwrjs/fs-asset-provider": "0.15.4",
56
- "@lwrjs/fs-watch": "0.15.4",
57
- "@lwrjs/html-view-provider": "0.15.4",
58
- "@lwrjs/instrumentation": "0.15.4",
59
- "@lwrjs/loader": "0.15.4",
60
- "@lwrjs/lwc-module-provider": "0.15.4",
61
- "@lwrjs/lwc-ssr": "0.15.4",
62
- "@lwrjs/markdown-view-provider": "0.15.4",
63
- "@lwrjs/module-bundler": "0.15.4",
64
- "@lwrjs/module-registry": "0.15.4",
65
- "@lwrjs/npm-module-provider": "0.15.4",
66
- "@lwrjs/nunjucks-view-provider": "0.15.4",
67
- "@lwrjs/o11y": "0.15.4",
68
- "@lwrjs/resource-registry": "0.15.4",
69
- "@lwrjs/router": "0.15.4",
70
- "@lwrjs/server": "0.15.4",
71
- "@lwrjs/shared-utils": "0.15.4",
72
- "@lwrjs/static": "0.15.4",
73
- "@lwrjs/view-registry": "0.15.4",
46
+ "@lwrjs/app-service": "0.15.6",
47
+ "@lwrjs/asset-registry": "0.15.6",
48
+ "@lwrjs/asset-transformer": "0.15.6",
49
+ "@lwrjs/base-view-provider": "0.15.6",
50
+ "@lwrjs/base-view-transformer": "0.15.6",
51
+ "@lwrjs/client-modules": "0.15.6",
52
+ "@lwrjs/config": "0.15.6",
53
+ "@lwrjs/diagnostics": "0.15.6",
54
+ "@lwrjs/esbuild": "0.15.6",
55
+ "@lwrjs/fs-asset-provider": "0.15.6",
56
+ "@lwrjs/fs-watch": "0.15.6",
57
+ "@lwrjs/html-view-provider": "0.15.6",
58
+ "@lwrjs/instrumentation": "0.15.6",
59
+ "@lwrjs/loader": "0.15.6",
60
+ "@lwrjs/lwc-module-provider": "0.15.6",
61
+ "@lwrjs/lwc-ssr": "0.15.6",
62
+ "@lwrjs/markdown-view-provider": "0.15.6",
63
+ "@lwrjs/module-bundler": "0.15.6",
64
+ "@lwrjs/module-registry": "0.15.6",
65
+ "@lwrjs/npm-module-provider": "0.15.6",
66
+ "@lwrjs/nunjucks-view-provider": "0.15.6",
67
+ "@lwrjs/o11y": "0.15.6",
68
+ "@lwrjs/resource-registry": "0.15.6",
69
+ "@lwrjs/router": "0.15.6",
70
+ "@lwrjs/server": "0.15.6",
71
+ "@lwrjs/shared-utils": "0.15.6",
72
+ "@lwrjs/static": "0.15.6",
73
+ "@lwrjs/view-registry": "0.15.6",
74
74
  "chokidar": "^3.6.0",
75
75
  "esbuild": "^0.9.7",
76
76
  "fs-extra": "^11.2.0",
@@ -80,7 +80,7 @@
80
80
  "ws": "^8.18.0"
81
81
  },
82
82
  "devDependencies": {
83
- "@lwrjs/types": "0.15.4",
83
+ "@lwrjs/types": "0.15.6",
84
84
  "@types/ws": "^8.5.12",
85
85
  "memfs": "^4.13.0"
86
86
  },
@@ -93,5 +93,5 @@
93
93
  "volta": {
94
94
  "extends": "../../../package.json"
95
95
  },
96
- "gitHead": "7e461b5d43aeaf5adce95b2ab8fec57748c4fa07"
96
+ "gitHead": "149a9606a77347eb0ba326497f8fcde5c855d5f8"
97
97
  }