http: don't write empty data on req/res end() · nodejs/node@0bf8291 · GitHub
Skip to content

Commit 0bf8291

Browse files
santigimenodanielleadams
authored andcommitted
http: don't write empty data on req/res end()
When calling OutgoingMessage.end() with empty data argument, avoid writing to the socket unless there's still pending data to be sent. Fixes: #41062 PR-URL: #41116 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 5356dfd commit 0bf8291

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

lib/_http_outgoing.js

Lines changed: 3 additions & 2 deletions

test/parallel/test-http-sync-write-error-during-continue.js

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)