summaryrefslogtreecommitdiff
path: root/cli/js/web/fetch.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/web/fetch.ts')
-rw-r--r--cli/js/web/fetch.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/cli/js/web/fetch.ts b/cli/js/web/fetch.ts
index c7209943f..acf0bad0f 100644
--- a/cli/js/web/fetch.ts
+++ b/cli/js/web/fetch.ts
@@ -531,6 +531,9 @@ export async function fetch(
redirected
);
if ([301, 302, 303, 307, 308].includes(response.status)) {
+ // We won't use body of received response, so close it now
+ // otherwise it will be kept in resource table.
+ close(fetchResponse.bodyRid);
// We're in a redirect status
switch ((init && init.redirect) || "follow") {
case "error":