From c67c616ad3f06f52ce4ac22cb7c5e0b735cff62a Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 10 Feb 2023 09:33:34 +0100 Subject: [PATCH] fixup! http: speedup strict content length --- 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 ef57b52dc74bbd..4b859a154a2ec0 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 (size != null && conn && conn.writable && !this._removedContLen && this._hasBody) { + if (this.strictContentLength && size != null && conn && conn.writable && !this._removedContLen && this._hasBody) { const skip = conn._httpMessage.statusCode === 304 || (this.hasHeader('transfer-encoding') || this.chunkedEncoding); if (typeof this._contentLength === 'number' && !skip) {