From dd09cc5bf9074bcb67ae8ee7a86744275ae41714 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 10 Feb 2023 09:35:34 +0100 Subject: [PATCH] http: count writtenBytes even if socket is not ready --- lib/_http_outgoing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 4b859a154a2ec0d..7e4d3073e9f2127 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -391,7 +391,7 @@ function _writeRaw(data, encoding, callback, size) { } // TODO(sidwebworks): flip the `strictContentLength` default to `true` in a future PR - if (this.strictContentLength && size != null && conn && conn.writable && !this._removedContLen && this._hasBody) { + if (this.strictContentLength && size != null && !this._removedContLen && this._hasBody) { const skip = conn._httpMessage.statusCode === 304 || (this.hasHeader('transfer-encoding') || this.chunkedEncoding); if (typeof this._contentLength === 'number' && !skip) {