Skip to content

Commit 07c55d2

Browse files
committed
Revert "http: make HEAD method to work with keep-alive"
This reverts commit 7afa533. The change breaks clients like cURL. Fixes: #38922 PR-URL: #38949 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Mary Marchini <oss@mmarchini.me> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
1 parent d8da265 commit 07c55d2

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

lib/_http_outgoing.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,7 @@ function _storeHeader(firstLine, headers) {
447447
}
448448

449449
if (!state.contLen && !state.te) {
450-
if (!this._hasBody && (this.statusCode === 204 ||
451-
this.statusCode === 304)) {
450+
if (!this._hasBody) {
452451
// Make sure we don't end the 0\r\n\r\n at the end of the message.
453452
this.chunkedEncoding = false;
454453
} else if (!this.useChunkedEncodingByDefault) {

test/parallel/test-http-reuse-socket.js

-51
This file was deleted.

0 commit comments

Comments
 (0)