@middy/s3-object-response 7.2.2 → 7.2.3

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 +3 -1
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -20,6 +20,7 @@ const s3ObjectResponseMiddleware = (opts = {}) => {
20
20
  const options = { ...defaults, ...opts };
21
21
 
22
22
  let client;
23
+ let clientInit;
23
24
  if (canPrefetch(options)) {
24
25
  client = createPrefetchClient(options);
25
26
  }
@@ -32,7 +33,8 @@ const s3ObjectResponseMiddleware = (opts = {}) => {
32
33
 
33
34
  const s3ObjectResponseMiddlewareAfter = async (request) => {
34
35
  if (!client) {
35
- client = await createClient(options, request);
36
+ clientInit ??= createClient(options, request);
37
+ client = await clientInit;
36
38
  }
37
39
 
38
40
  const command = new WriteGetObjectResponseCommand({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/s3-object-response",
3
- "version": "7.2.2",
3
+ "version": "7.2.3",
4
4
  "description": "S3 object response handling middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -73,11 +73,11 @@
73
73
  }
74
74
  },
75
75
  "dependencies": {
76
- "@middy/util": "7.2.2"
76
+ "@middy/util": "7.2.3"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@aws-sdk/client-s3": "^3.0.0",
80
- "@middy/core": "7.2.2",
80
+ "@middy/core": "7.2.3",
81
81
  "@types/aws-lambda": "^8.0.0",
82
82
  "@types/node": "^22.0.0",
83
83
  "aws-xray-sdk": "^3.3.3"