From e259ee6810e702bc6cfa6aaeb2a027ef2ed61334 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Thu, 16 Feb 2023 20:06:10 +0100 Subject: [PATCH] fixup: linting --- lib/_http_outgoing.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index c7f13ddc0f71a2..7ac93bd3d8f498 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -840,13 +840,13 @@ function emitErrorNt(msg, err, callback) { function strictContentLength(msg) { return ( - msg._contentLength != null && msg.strictContentLength && + msg._contentLength != null && msg._hasBody && !msg._removedContLen && !msg.chunkedEncoding && !msg.hasHeader('transfer-encoding') - ) + ); } function write_(msg, chunk, encoding, callback, fromEnd) { @@ -880,7 +880,9 @@ function write_(msg, chunk, encoding, callback, fromEnd) { typeof chunk === 'string' ? Buffer.byteLength(chunk, encoding) : chunk.byteLength : null; if (len != null) { - if (strictContentLength(msg) && (fromEnd ? msg[kBytesWritten] + len !== msg._contentLength : msg[kBytesWritten] + len > msg._contentLength) + if ( + strictContentLength(msg) && + (fromEnd ? msg[kBytesWritten] + len !== msg._contentLength : msg[kBytesWritten] + len > msg._contentLength) ) { throw new ERR_HTTP_CONTENT_LENGTH_MISMATCH(len + msg[kBytesWritten], msg._contentLength); }