@middy/s3-object-response 7.1.1 → 7.1.2

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.
Files changed (2) hide show
  1. package/index.js +5 -3
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -3,9 +3,9 @@
3
3
  import { S3Client, WriteGetObjectResponseCommand } from "@aws-sdk/client-s3";
4
4
  import {
5
5
  canPrefetch,
6
+ catchInvalidSignatureException,
6
7
  createClient,
7
8
  createPrefetchClient,
8
- // catchInvalidSignatureException
9
9
  } from "@middy/util";
10
10
 
11
11
  const defaults = {
@@ -40,8 +40,10 @@ const s3ObjectResponseMiddleware = (opts = {}) => {
40
40
  RequestToken: request.event.getObjectContext?.outputToken,
41
41
  Body: request.response.Body ?? request.response.body,
42
42
  });
43
- await client.send(command); // Doesn't return a promise?
44
- // .catch((e) => catchInvalidSignatureException(e, client, command))
43
+ await client
44
+ .send(command)
45
+ // ?. required due to mockClient able to return undefined
46
+ ?.catch((e) => catchInvalidSignatureException(e, client, command));
45
47
 
46
48
  return { statusCode: 200 };
47
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/s3-object-response",
3
- "version": "7.1.1",
3
+ "version": "7.1.2",
4
4
  "description": "S3 object response handling middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -74,12 +74,12 @@
74
74
  },
75
75
  "devDependencies": {
76
76
  "@aws-sdk/client-s3": "^3.0.0",
77
- "@middy/core": "7.1.1",
77
+ "@middy/core": "7.1.2",
78
78
  "@types/aws-lambda": "^8.0.0",
79
79
  "aws-xray-sdk": "^3.3.3"
80
80
  },
81
81
  "dependencies": {
82
- "@middy/util": "7.1.1"
82
+ "@middy/util": "7.1.2"
83
83
  },
84
84
  "gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
85
85
  }