Skip to content

Commit 481ed62

Browse files
committed
http: count writtenBytes even if socket is not ready
1 parent ad2162a commit 481ed62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/_http_outgoing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ function _writeRaw(data, encoding, callback, size) {
391391
}
392392

393393
// TODO(sidwebworks): flip the `strictContentLength` default to `true` in a future PR
394-
if (this.strictContentLength && size != null && conn && conn.writable && !this._removedContLen && this._hasBody) {
394+
if (this.strictContentLength && size != null && !this._removedContLen && this._hasBody) {
395395
const skip = conn._httpMessage.statusCode === 304 || (this.hasHeader('transfer-encoding') || this.chunkedEncoding);
396396

397397
if (typeof this._contentLength === 'number' && !skip) {

0 commit comments

Comments
 (0)