Based on test-http-response-status-message.js.
This will succeed with --http-parser legacy but fail otherwise.
Related #27984 (comment), #28120
'use strict';
const common = require('../common');
const http = require('http');
const net = require('net');
const server = net.createServer(function(con) {
con.on('data', function(data) {
con.write('HTTP/1.1 200\r\n\r\n');
con.end();
});
});
server.listen(0, function() {
http.get({
port: server.address().port
}, function(res) {
res.on('aborted', common.mustNotCall());
res.on('end', common.mustCall());
res.resume();
});
});