@lwrjs/core 0.13.0-alpha.25 → 0.13.0-alpha.26

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.
@@ -50,10 +50,12 @@ function requestProcessorMiddleware(app, context) {
50
50
  const host = req.headers["host"];
51
51
  const forwardedProto = req.headers["x-forwarded-proto"];
52
52
  const protocol = req.protocol;
53
- import_diagnostics.logger.info({
54
- label: `request-processor-middleware`,
55
- message: `Original Url: ${req.originalUrl}, Forwarded: ${forwarded}, X-Forwarded-Proto: ${forwardedProto}, Host: ${host}, Protocol: ${protocol}, ${MRT_REQUEST_CLASS}: ${requestClass}, ${import_shared_utils.REQUEST_DEPTH_HEADER}: ${requestDepth}`
56
- });
53
+ if ((0, import_shared_utils.isLambdaEnv)()) {
54
+ import_diagnostics.logger.info({
55
+ label: `request-processor-middleware`,
56
+ message: `Original Url: ${req.originalUrl}, Forwarded: ${forwarded}, X-Forwarded-Proto: ${forwardedProto}, Host: ${host}, Protocol: ${protocol}, ${MRT_REQUEST_CLASS}: ${requestClass}, ${import_shared_utils.REQUEST_DEPTH_HEADER}: ${requestDepth}`
57
+ });
58
+ }
57
59
  }
58
60
  if (requestDepth && requestDepth > 0) {
59
61
  import_diagnostics.logger.error({
@@ -7,7 +7,7 @@
7
7
  *
8
8
  */
9
9
  import { logger } from '@lwrjs/diagnostics';
10
- import { REQUEST_DEPTH_HEADER, parseRequestDepthHeader } from '@lwrjs/shared-utils';
10
+ import { REQUEST_DEPTH_HEADER, isLambdaEnv, parseRequestDepthHeader } from '@lwrjs/shared-utils';
11
11
  const MRT_REQUEST_CLASS = 'X-Mobify-Request-Class';
12
12
  const MRT_REQUEST_CLASS_KEY = MRT_REQUEST_CLASS.toLowerCase();
13
13
  export function requestProcessorMiddleware(app, context) {
@@ -32,10 +32,13 @@ export function requestProcessorMiddleware(app, context) {
32
32
  const host = req.headers['host'];
33
33
  const forwardedProto = req.headers['x-forwarded-proto'];
34
34
  const protocol = req.protocol;
35
- logger.info({
36
- label: `request-processor-middleware`,
37
- message: `Original Url: ${req.originalUrl}, Forwarded: ${forwarded}, X-Forwarded-Proto: ${forwardedProto}, Host: ${host}, Protocol: ${protocol}, ${MRT_REQUEST_CLASS}: ${requestClass}, ${REQUEST_DEPTH_HEADER}: ${requestDepth}`,
38
- });
35
+ // Only Add this log when on MRT. Useful to catch issues where CDN did not send us the right info.
36
+ if (isLambdaEnv()) {
37
+ logger.info({
38
+ label: `request-processor-middleware`,
39
+ message: `Original Url: ${req.originalUrl}, Forwarded: ${forwarded}, X-Forwarded-Proto: ${forwardedProto}, Host: ${host}, Protocol: ${protocol}, ${MRT_REQUEST_CLASS}: ${requestClass}, ${REQUEST_DEPTH_HEADER}: ${requestDepth}`,
40
+ });
41
+ }
39
42
  }
40
43
  // TODO Clean up once we have a long term solution
41
44
  if (requestDepth && requestDepth > 0) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.13.0-alpha.25",
7
+ "version": "0.13.0-alpha.26",
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.13.0-alpha.25",
47
- "@lwrjs/asset-registry": "0.13.0-alpha.25",
48
- "@lwrjs/asset-transformer": "0.13.0-alpha.25",
49
- "@lwrjs/base-view-provider": "0.13.0-alpha.25",
50
- "@lwrjs/base-view-transformer": "0.13.0-alpha.25",
51
- "@lwrjs/client-modules": "0.13.0-alpha.25",
52
- "@lwrjs/config": "0.13.0-alpha.25",
53
- "@lwrjs/diagnostics": "0.13.0-alpha.25",
54
- "@lwrjs/esbuild": "0.13.0-alpha.25",
55
- "@lwrjs/fs-asset-provider": "0.13.0-alpha.25",
56
- "@lwrjs/fs-watch": "0.13.0-alpha.25",
57
- "@lwrjs/html-view-provider": "0.13.0-alpha.25",
58
- "@lwrjs/instrumentation": "0.13.0-alpha.25",
59
- "@lwrjs/loader": "0.13.0-alpha.25",
60
- "@lwrjs/lwc-module-provider": "0.13.0-alpha.25",
61
- "@lwrjs/lwc-ssr": "0.13.0-alpha.25",
62
- "@lwrjs/markdown-view-provider": "0.13.0-alpha.25",
63
- "@lwrjs/module-bundler": "0.13.0-alpha.25",
64
- "@lwrjs/module-registry": "0.13.0-alpha.25",
65
- "@lwrjs/npm-module-provider": "0.13.0-alpha.25",
66
- "@lwrjs/nunjucks-view-provider": "0.13.0-alpha.25",
67
- "@lwrjs/o11y": "0.13.0-alpha.25",
68
- "@lwrjs/resource-registry": "0.13.0-alpha.25",
69
- "@lwrjs/router": "0.13.0-alpha.25",
70
- "@lwrjs/server": "0.13.0-alpha.25",
71
- "@lwrjs/shared-utils": "0.13.0-alpha.25",
72
- "@lwrjs/static": "0.13.0-alpha.25",
73
- "@lwrjs/view-registry": "0.13.0-alpha.25",
46
+ "@lwrjs/app-service": "0.13.0-alpha.26",
47
+ "@lwrjs/asset-registry": "0.13.0-alpha.26",
48
+ "@lwrjs/asset-transformer": "0.13.0-alpha.26",
49
+ "@lwrjs/base-view-provider": "0.13.0-alpha.26",
50
+ "@lwrjs/base-view-transformer": "0.13.0-alpha.26",
51
+ "@lwrjs/client-modules": "0.13.0-alpha.26",
52
+ "@lwrjs/config": "0.13.0-alpha.26",
53
+ "@lwrjs/diagnostics": "0.13.0-alpha.26",
54
+ "@lwrjs/esbuild": "0.13.0-alpha.26",
55
+ "@lwrjs/fs-asset-provider": "0.13.0-alpha.26",
56
+ "@lwrjs/fs-watch": "0.13.0-alpha.26",
57
+ "@lwrjs/html-view-provider": "0.13.0-alpha.26",
58
+ "@lwrjs/instrumentation": "0.13.0-alpha.26",
59
+ "@lwrjs/loader": "0.13.0-alpha.26",
60
+ "@lwrjs/lwc-module-provider": "0.13.0-alpha.26",
61
+ "@lwrjs/lwc-ssr": "0.13.0-alpha.26",
62
+ "@lwrjs/markdown-view-provider": "0.13.0-alpha.26",
63
+ "@lwrjs/module-bundler": "0.13.0-alpha.26",
64
+ "@lwrjs/module-registry": "0.13.0-alpha.26",
65
+ "@lwrjs/npm-module-provider": "0.13.0-alpha.26",
66
+ "@lwrjs/nunjucks-view-provider": "0.13.0-alpha.26",
67
+ "@lwrjs/o11y": "0.13.0-alpha.26",
68
+ "@lwrjs/resource-registry": "0.13.0-alpha.26",
69
+ "@lwrjs/router": "0.13.0-alpha.26",
70
+ "@lwrjs/server": "0.13.0-alpha.26",
71
+ "@lwrjs/shared-utils": "0.13.0-alpha.26",
72
+ "@lwrjs/static": "0.13.0-alpha.26",
73
+ "@lwrjs/view-registry": "0.13.0-alpha.26",
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.17.1"
81
81
  },
82
82
  "devDependencies": {
83
- "@lwrjs/types": "0.13.0-alpha.25",
83
+ "@lwrjs/types": "0.13.0-alpha.26",
84
84
  "@types/ws": "^8.5.10",
85
85
  "mock-fs": "^5.2.0"
86
86
  },
@@ -93,5 +93,5 @@
93
93
  "volta": {
94
94
  "extends": "../../../package.json"
95
95
  },
96
- "gitHead": "fe2a578eb76a99cc274ea970c3f24bbc6f15fdba"
96
+ "gitHead": "8e25bd9fe2fa9e9b89224dc521043d0bb868178b"
97
97
  }