summaryrefslogtreecommitdiff
path: root/ext/fetch/22_http_client.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fetch/22_http_client.js')
-rw-r--r--ext/fetch/22_http_client.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/fetch/22_http_client.js b/ext/fetch/22_http_client.js
index 9d37f1b7f..45f5de80e 100644
--- a/ext/fetch/22_http_client.js
+++ b/ext/fetch/22_http_client.js
@@ -12,6 +12,7 @@
const core = globalThis.Deno.core;
const ops = core.ops;
+import { SymbolDispose } from "ext:deno_web/00_infra.js";
/**
* @param {Deno.CreateHttpClientOptions} options
@@ -33,9 +34,14 @@ class HttpClient {
constructor(rid) {
this.rid = rid;
}
+
close() {
core.close(this.rid);
}
+
+ [SymbolDispose]() {
+ core.tryClose(this.rid);
+ }
}
const HttpClientPrototype = HttpClient.prototype;