Skip to content

Commit 64cb619

Browse files
authored
fix: only add custom properties that aren't in the request object (openapi-ts#1672)
* fix: only add custom properties that aren't in the request object Closes openapi-ts#1666 * add changeset
1 parent f6930af commit 64cb619

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/wet-apples-hide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-fetch": patch
3+
---
4+
5+
Fixes issue where native properties were not excluded from custom properties in the CustomRequest class

packages/openapi-fetch/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CustomRequest extends Request {
1414

1515
// add custom parameters
1616
for (const key in init) {
17-
if (!this[key]) {
17+
if (!(key in this)) {
1818
this[key] = init[key];
1919
}
2020
}

0 commit comments

Comments
 (0)