@middy/s3-object-response 5.3.4 → 5.3.5

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 -11
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -34,17 +34,11 @@ const s3ObjectResponseMiddleware = (opts = {}) => {
34
34
  client = await createClient(options, request)
35
35
  }
36
36
 
37
- request.response.RequestRoute = request.event.getObjectContext.outputRoute
38
- request.response.RequestToken = request.event.getObjectContext.outputToken
39
-
40
- if (request.response.body) {
41
- request.response.Body = request.response.body
42
- delete request.response.body
43
- }
44
-
45
- const command = new WriteGetObjectResponseCommand(
46
- request.internal.s3ObjectResponse
47
- )
37
+ const command = new WriteGetObjectResponseCommand({
38
+ RequestRoute: request.event.getObjectContext.outputRoute,
39
+ RequestToken: request.event.getObjectContext.outputToken,
40
+ Body: request.response.Body ?? request.response.body
41
+ })
48
42
  await client.send(command) // Doesn't return a promise?
49
43
  // .catch((e) => catchInvalidSignatureException(e, client, command))
50
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/s3-object-response",
3
- "version": "5.3.4",
3
+ "version": "5.3.5",
4
4
  "description": "S3 object response handling middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -64,5 +64,5 @@
64
64
  "@types/aws-lambda": "^8.10.101",
65
65
  "aws-xray-sdk": "^3.3.3"
66
66
  },
67
- "gitHead": "37632cf8463e8834c09e91bff14817b7e1e2e8ee"
67
+ "gitHead": "002f91e437e052485848e1550e58e58af126b520"
68
68
  }