Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory-leak on fetch
Browse files Browse the repository at this point in the history
timursevimli committed Feb 27, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 99ce72d commit 90510dd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/network.js
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@ const httpApiCall = async (url, { method = 'POST', headers = {}, body }) => {
return await fetch(url, options).then(async (res) => {
const code = res.status;
if (code === 200) return await res.json();
await res.body.cancel();
const dest = `for ${method} ${url}`;
throw new Error(`HTTP status code ${code} ${dest}`);
});

0 comments on commit 90510dd

Please sign in to comment.