Repository: node
Issue: Potential Regression/Change: Connection doesn't reset on HEAD
Labels: http

<!--
Thank you for reporting an issue.

This issue tracker is for bugs and issues found within Node.js core.
If you require more general support please file an issue on our help
repo. https://github.com/nodejs/help


Please fill in as much of the template below as you're able.

Version: output of `node -v`
Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)
Subsystem: if known, please specify affected core module name
-->

* **Version**: v15.0.0-pre
* **Platform**: Linux 4.19.121-microsoft-standard SMP Fri Jun 19 21:06:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
* **Subsystem**: http

### What steps will reproduce the bug?

<!--
Enter details about your bug, preferably a simple code snippet that can be
run using `node` directly without installing third-party dependencies.
-->
HEAD request to server that responds with `Content-Length` or `Content-Encoding`, for example wikipedia.org, or any S3 file.
```
var http = require("http");

var agent = new http.Agent();
agent.maxSockets = 1;

var sockets = [];

function request(hostname, path, method, callback) {
    var options = {
        hostname: hostname,
        port: 80,
        path: path,
        agent: agent,
        method: method,
        headers: { "Connection": "keep-alive" }
    };
    var req = http.request(options, function (res) {
        console.log("Got response: " + res.statusCode);

        res.setEncoding('utf8');
        var body = "";
        res.on('data', function (chunk) {
            body += chunk;
            console.log("Data Recieved");
        });
        res.on('end', function () {
            console.log(JSON.stringify(res.headers));
            if (!res.complete) {
                console.error(
                    'The connection was terminated while the message was still being sent');
            }
            console.log(sockets.length)
        });
    });


    req.on('error', function (e) {
        console.log(e);
        return callback(e);
    });
    req.on("socket", function (socket) {
        if (sockets.indexOf(socket) === -1) {
            console.log("new socket created");
            sockets.push(socket);
            socket.on("close", function () {
                console.log("socket has been closed");
            });
        }
    });
    req.end()
}

function run(method) {

    request('wikipedia.org', '/', method, function (e, res, body) {
        console.log(e);
    });
}
console.log("HEAD")
run("HEAD");
run("HEAD");
run("HEAD");
```
### How often does it reproduce? Is there a required condition?
Always, if the response headers contain payload headers (`content-length`, `content-encoding`).

### What is the expected behavior?
According to https://github.com/nodejs/node/issues/12396, this is a bug, and we would expect all HEAD requests to close the socket.

IMHO, the current behavior is equally compliant.
<!--
If possible please provide textual output instead of screenshots.
-->

### What do you see instead?
Keep-alive is respected, socket remains open for multiple requests.
<!--
If possible please provide textual output instead of screenshots.
-->

### Additional information
I don't think this is actually a bug, I just wanted to draw attention to the fact that either the behavior changed without people noticing since 2017, or the original reporter was testing exclusively against servers that don't report payloads for HEAD (which includes node).

This is also the thrust of my PR to add those headers to node's server: https://github.com/nodejs/node/pull/34231
And related issue: https://github.com/nodejs/node/issues/28438
<!--
Tell us anything else you think we should know.
-->