summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/http.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/http.ts')
-rw-r--r--ext/node/polyfills/http.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index 0ef245902..51d228d4e 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -765,6 +765,9 @@ class ClientRequest extends OutgoingMessage {
// deno-lint-ignore no-explicit-any
end(chunk?: any, encoding?: any, cb?: any): this {
+ // Do nothing if request is already destroyed.
+ if (this.destroyed) return this;
+
if (typeof chunk === "function") {
cb = chunk;
chunk = null;
@@ -797,6 +800,8 @@ class ClientRequest extends OutgoingMessage {
//
}
})();
+
+ return this;
}
abort() {