@middy/s3-object-response 6.0.0 → 6.1.1
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.
- package/README.md +1 -1
- package/index.js +4 -4
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
## License
|
|
41
41
|
|
|
42
|
-
Licensed under [MIT License](LICENSE). Copyright (c) 2017-
|
|
42
|
+
Licensed under [MIT License](LICENSE). Copyright (c) 2017-2025 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell), and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
|
|
43
43
|
|
|
44
44
|
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy?ref=badge_large">
|
|
45
45
|
<img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy.svg?type=large" alt="FOSSA Status" style="max-width:100%;">
|
package/index.js
CHANGED
|
@@ -24,9 +24,9 @@ const s3ObjectResponseMiddleware = (opts = {}) => {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const s3ObjectResponseMiddlewareBefore = async (request) => {
|
|
27
|
-
const { inputS3Url } = request.event.getObjectContext
|
|
27
|
+
const { inputS3Url } = request.event.getObjectContext ?? {}
|
|
28
28
|
|
|
29
|
-
request.context.s3ObjectFetch = fetch(inputS3Url)
|
|
29
|
+
request.context.s3ObjectFetch = inputS3Url ? fetch(inputS3Url) : undefined
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const s3ObjectResponseMiddlewareAfter = async (request) => {
|
|
@@ -35,8 +35,8 @@ const s3ObjectResponseMiddleware = (opts = {}) => {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const command = new WriteGetObjectResponseCommand({
|
|
38
|
-
RequestRoute: request.event.getObjectContext
|
|
39
|
-
RequestToken: request.event.getObjectContext
|
|
38
|
+
RequestRoute: request.event.getObjectContext?.outputRoute,
|
|
39
|
+
RequestToken: request.event.getObjectContext?.outputToken,
|
|
40
40
|
Body: request.response.Body ?? request.response.body
|
|
41
41
|
})
|
|
42
42
|
await client.send(command) // Doesn't return a promise?
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/s3-object-response",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "S3 object response handling middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -28,8 +28,9 @@
|
|
|
28
28
|
"index.d.ts"
|
|
29
29
|
],
|
|
30
30
|
"scripts": {
|
|
31
|
-
"test": "npm run test:unit",
|
|
31
|
+
"test": "npm run test:unit && npm run test:fuzz",
|
|
32
32
|
"test:unit": "node --test __tests__/index.js",
|
|
33
|
+
"test:fuzz": "node --test __tests__/fuzz.js",
|
|
33
34
|
"test:benchmark": "node __benchmarks__/index.js"
|
|
34
35
|
},
|
|
35
36
|
"license": "MIT",
|
|
@@ -51,7 +52,7 @@
|
|
|
51
52
|
},
|
|
52
53
|
"repository": {
|
|
53
54
|
"type": "git",
|
|
54
|
-
"url": "github
|
|
55
|
+
"url": "git+https://github.com/middyjs/middy.git",
|
|
55
56
|
"directory": "packages/sts"
|
|
56
57
|
},
|
|
57
58
|
"bugs": {
|