-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix support for Node.js v18's native
fetch
when making `DELETE…
…` requests with no body Currently, `DELETE` requests without a body don't work on the latest Node.js version, v18, because we try to set `content-length: 0` which is not allowed by the native `fetch` implementation which is included in Node. It throws an error with the `UND_ERR_REQ_CONTENT_LENGTH_MISMATCH` code. This stops manually setting that `content-length: 0` header for `DELETE` requests. I've tested this against the GitHub API with Node.js v18 and v17, and both work as expected, with the GitHub API also accepting the request. As part of this PR, I've also added some new tests covering what happens with different HTTP methods. Fixes octokit/request.js#506.
- Loading branch information
Showing
2 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters