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.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index 1a585f74c..6f7877742 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -351,6 +351,18 @@ class ClientRequest extends NodeWritable {
}
setTimeout(timeout: number, callback?: () => void) {
+ if (timeout == 0) {
+ // Node's underlying Socket implementation expects a 0 value to disable the
+ // existing timeout.
+ if (this.opts.timeout) {
+ clearTimeout(this.opts.timeout);
+ this.opts.timeout = undefined;
+ this.opts.signal = undefined;
+ }
+
+ return;
+ }
+
const controller = new AbortController();
this.opts.signal = controller.signal;