Skip to content

Commit

Permalink
fix: overwrite default value for acceptStatusCodes
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed May 16, 2024
1 parent 8485796 commit 7d5af55
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ class HttpFetchArgs {
*/
constructor(partial: Partial<HttpFetchArgs>) {
Object.assign(this, partial);

// TODO: Find neat solution for this problem. Since JS-Runner uses an
// empty list as a default value, it will always be overwritten using
// Object.assign.
if (this.acceptStatusCodes.length === 0) {
this.acceptStatusCodes.push("200-300");
}
}

/**
Expand Down

0 comments on commit 7d5af55

Please sign in to comment.