@middy/http-cors 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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +1 -1
  3. package/package.json +6 -5
package/README.md CHANGED
@@ -39,7 +39,7 @@
39
39
 
40
40
  ## License
41
41
 
42
- Licensed under [MIT License](LICENSE). Copyright (c) 2017-2024 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell), and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
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
@@ -154,7 +154,7 @@ const httpCorsMiddleware = (opts = {}) => {
154
154
 
155
155
  const httpCorsMiddlewareAfter = async (request) => {
156
156
  normalizeHttpResponse(request)
157
- const { headers } = request.response
157
+ const headers = structuredClone(request.response.headers)
158
158
  modifyHeaders(headers, options, request)
159
159
  request.response.headers = headers
160
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/http-cors",
3
- "version": "6.0.0",
3
+ "version": "6.1.1",
4
4
  "description": "CORS (Cross-Origin Resource Sharing) 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",
@@ -50,7 +51,7 @@
50
51
  },
51
52
  "repository": {
52
53
  "type": "git",
53
- "url": "github:middyjs/middy",
54
+ "url": "git+https://github.com/middyjs/middy.git",
54
55
  "directory": "packages/http-cors"
55
56
  },
56
57
  "bugs": {
@@ -63,9 +64,9 @@
63
64
  },
64
65
  "gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
65
66
  "dependencies": {
66
- "@middy/util": "6.0.0"
67
+ "@middy/util": "6.1.0"
67
68
  },
68
69
  "devDependencies": {
69
- "@middy/core": "6.0.0"
70
+ "@middy/core": "6.1.0"
70
71
  }
71
72
  }