Skip to content

Commit

Permalink
http: count writtenBytes even if socket is not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Feb 10, 2023
1 parent c67c616 commit dd09cc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit dd09cc5

Please sign in to comment.