Skip to content

Commit

Permalink
enhance(utils/getHeadersObj): prevent ownKeys trap to return the sa…
Browse files Browse the repository at this point in the history
…me keys
  • Loading branch information
ardatan committed Feb 23, 2024
1 parent 1b3c332 commit 0f274ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eighty-beds-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-mesh/utils": patch
---

Prevent `ownKeys` trap to return the same keys
2 changes: 1 addition & 1 deletion packages/utils/src/getHeadersObj.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function getHeadersObj(
return headers.has(name.toString().toLowerCase());
},
ownKeys(_target) {
return [...headers.keys()];
return [...new Set(headers.keys())];
},
set(_target, name, value) {
headers.set(name.toString().toLowerCase(), value);
Expand Down

0 comments on commit 0f274ef

Please sign in to comment.