diff --git a/lib/client.js b/lib/client.js index 3715d7ead20..b230c368dab 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1668,6 +1668,8 @@ class AsyncWriter { process.emitWarning(new RequestContentLengthMismatchError()) } + socket.cork() + if (bytesWritten === 0) { if (!expectsPayload) { socket[kReset] = true @@ -1688,6 +1690,8 @@ class AsyncWriter { const ret = socket.write(chunk) + socket.uncork() + request.onBodySent(chunk) if (!ret) {