From bf4e99cbd77087706e7ea7034bd90079c2218e2b Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Wed, 19 Jul 2023 01:30:19 +0200 Subject: fix(node/http): call callback after request is sent (#19871) Fixes #19762 --- ext/node/polyfills/http.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ext/node/polyfills') diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index 391906c40..17ab8ce31 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -629,14 +629,13 @@ class ClientRequest extends OutgoingMessage { core.tryClose(this._bodyWriteRid); } - - try { - cb?.(); - } catch (_) { - // - } })(), ]); + try { + cb?.(); + } catch (_) { + // + } if (this._timeout) { this._timeout.removeEventListener("abort", this._timeoutCb); webClearTimeout(this._timeout[timerId]); -- cgit v1.2.3