mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00
http: don't emit 'readable' after 'close'
PR-URL: https://github.com/nodejs/node/pull/32277 Refs: https://github.com/nodejs/node/issues/28710 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
19db0e60bd
commit
e034f5c3d9
3 changed files with 12 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
'use strict';
|
||||
require('../common');
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const async_hooks = require('async_hooks');
|
||||
const http = require('http');
|
||||
|
@ -45,6 +45,9 @@ async_hooks.createHook({
|
|||
}).enable();
|
||||
|
||||
const server = http.createServer((req, res) => {
|
||||
req.on('close', common.mustCall(() => {
|
||||
req.on('readable', common.mustNotCall());
|
||||
}));
|
||||
res.end('Hello');
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue