diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts index 39bc82fb0e..e9fb61dc41 100644 --- a/cli/tests/unit/http_test.ts +++ b/cli/tests/unit/http_test.ts @@ -871,7 +871,6 @@ Deno.test( await respondWith(new Response(f.readable, { status: 200 })); httpConn.close(); listener.close(); - f.close(); })(); const resp = await fetch("http://127.0.0.1:4503/"); const body = await resp.arrayBuffer(); diff --git a/ext/http/01_http.js b/ext/http/01_http.js index 5c9deb5a34..c60a4b05ab 100644 --- a/ext/http/01_http.js +++ b/ext/http/01_http.js @@ -281,6 +281,7 @@ streamRid, resourceRid, ); + core.tryClose(resourceRid); readableStreamClose(respBody); // Release JS lock. } catch (error) { const connError = httpConn[connErrorSymbol];