Closed
Description
- Version: v10.15.0
- Platform: Linux glossy 4.19.0-1-amd64 deps: update openssl to 1.0.1j #1 SMP Debian 4.19.12-1 (2018-12-22) x86_64 GNU/Linux
- Subsystem: http
According to #21063 and #21809 in Node v10 HTTP response should not emit 'close' if 'end' was emitted, but it still does:
'use strict';
const http = require('http');
const server = http.createServer(function (req, res) {
res.end('OK');
});
console.log(process.versions);
server.listen(8080, function () {
const req = http.get('http://localhost:8080/', function (res) {
res.on('data', function (chunk) {
console.log(`DATA: ${chunk}`);
});
res.on('close', function () {
console.log('CLOSE');
});
res.on('end', function () {
console.log('END');
server.close();
});
});
req.end();
});
output:
{ http_parser: '2.8.0',
node: '10.15.0',
v8: '6.8.275.32-node.45',
uv: '1.23.2',
zlib: '1.2.11',
ares: '1.15.0',
modules: '64',
nghttp2: '1.34.0',
napi: '3',
openssl: '1.1.0j',
icu: '62.1',
unicode: '11.0',
cldr: '33.1',
tz: '2018e' }
DATA: OK
END
CLOSE
Metadata
Metadata
Assignees
Labels
No labels