quidproquo-actionprocessor-awslambda 0.0.247 → 0.0.248

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.
@@ -12,11 +12,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getCloudFrontRequestEvent_viewerRequest = exports.viewerRequestEventHandler = void 0;
13
13
  const quidproquo_webserver_1 = require("quidproquo-webserver");
14
14
  const viewerRequestEventHandler = (event, context) => __awaiter(void 0, void 0, void 0, function* () {
15
- var _a;
15
+ var _a, _b;
16
16
  console.log(JSON.stringify(event));
17
17
  const request = event.Records[0].cf.request;
18
- const headers = request.headers;
19
- const userAgent = ((_a = headers['user-agent'][0]) === null || _a === void 0 ? void 0 : _a.value) || 'unknown';
18
+ const headers = request.headers || {};
19
+ const userAgent = ((_b = (_a = headers['user-agent']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value) || 'unknown';
20
20
  // let isBot = userAgent.match(/bot|crawl|spider|slurp|facebot|facebookexternalhit/i);
21
21
  // Bot testing for integrating Prerender ~ you then do what you want inside the app business logic
22
22
  // For more info: https://docs.prerender.io/docs/apache-2
@@ -2,8 +2,8 @@ import { qpqHeaderIsBot } from 'quidproquo-webserver';
2
2
  export const viewerRequestEventHandler = async (event, context) => {
3
3
  console.log(JSON.stringify(event));
4
4
  const request = event.Records[0].cf.request;
5
- const headers = request.headers;
6
- const userAgent = headers['user-agent'][0]?.value || 'unknown';
5
+ const headers = request.headers || {};
6
+ const userAgent = headers['user-agent']?.[0]?.value || 'unknown';
7
7
  // let isBot = userAgent.match(/bot|crawl|spider|slurp|facebot|facebookexternalhit/i);
8
8
  // Bot testing for integrating Prerender ~ you then do what you want inside the app business logic
9
9
  // For more info: https://docs.prerender.io/docs/apache-2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-actionprocessor-awslambda",
3
- "version": "0.0.247",
3
+ "version": "0.0.248",
4
4
  "description": "",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -55,9 +55,9 @@
55
55
  "lodash": "^4.17.21",
56
56
  "node-cache": "^5.1.2",
57
57
  "node-match-path": "^0.6.3",
58
- "quidproquo-config-aws": "0.0.247",
59
- "quidproquo-core": "0.0.247",
60
- "quidproquo-webserver": "0.0.247"
58
+ "quidproquo-config-aws": "0.0.248",
59
+ "quidproquo-core": "0.0.248",
60
+ "quidproquo-webserver": "0.0.248"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/aws-lambda": "^8.10.109",
@@ -65,7 +65,7 @@
65
65
  "@types/jsonwebtoken": "^9.0.2",
66
66
  "@types/lodash": "^4.14.194",
67
67
  "@types/node": "^18.11.9",
68
- "quidproquo-tsconfig": "0.0.247",
68
+ "quidproquo-tsconfig": "0.0.248",
69
69
  "typescript": "^4.9.3"
70
70
  }
71
71
  }