Skip to content

Commit d60458c

Browse files
committed
http: end after close
1 parent b3172f8 commit d60458c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/parallel/test-http-server-keepalive-end.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@
33
const common = require('../common');
44
const { createServer } = require('http');
55
const { connect } = require('net');
6+
const assert = require('assert');
67

78
const server = createServer(common.mustCall((req, res) => {
8-
req.on('end', common.mustCall());
9+
let closeEmitted = false;
10+
req.on('close', () => {
11+
closeEmitted = true;
12+
})
13+
req.on('end', common.mustCall(() => {
14+
assert.strictEqual(closeEmitted, false);
15+
}));
916
res.end('hello world');
1017
}));
1118

0 commit comments

Comments
 (0)