Skip to content

Commit

Permalink
Revert "http: make HEAD method to work with keep-alive"
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
targos committed Jun 11, 2021
1 parent d8da265 commit 07c55d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 53 deletions.
3 changes: 1 addition & 2 deletions lib/_http_outgoing.js
Expand Up @@ -447,8 +447,7 @@ function _storeHeader(firstLine, headers) {
}

if (!state.contLen && !state.te) {
if (!this._hasBody && (this.statusCode === 204 ||
this.statusCode === 304)) {
if (!this._hasBody) {
// Make sure we don't end the 0\r\n\r\n at the end of the message.
this.chunkedEncoding = false;
} else if (!this.useChunkedEncodingByDefault) {
Expand Down
51 changes: 0 additions & 51 deletions test/parallel/test-http-reuse-socket.js

This file was deleted.

0 comments on commit 07c55d2

Please sign in to comment.