diff options
Diffstat (limited to 'ext/node/polyfills')
-rw-r--r-- | ext/node/polyfills/http.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index 6b862ce83..ec3fe6e0b 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -671,6 +671,9 @@ class ClientRequest extends OutgoingMessage { (async () => { try { const res = await op_fetch_send(this._req.requestRid); + if (this._req.cancelHandleRid !== null) { + core.tryClose(this._req.cancelHandleRid); + } try { cb?.(); } catch (_) { @@ -709,10 +712,6 @@ class ClientRequest extends OutgoingMessage { Object.entries(res.headers).flat().length, ); - if (this._req.cancelHandleRid !== null) { - core.tryClose(this._req.cancelHandleRid); - } - if (incoming.upgrade) { if (this.listenerCount("upgrade") === 0) { // No listeners, so we got nothing to do |