Skip to content

Commit 0f45ecb

Browse files
addaleaxrvagg
authored andcommitted
test: add http _dump regression test
Test part of 299da1f, specifically for v8.x. PR-URL: #21595 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 8f5e991 commit 0f45ecb

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
const http = require('http');
6+
7+
const server = http.createServer(common.mustCall(function(req, res) {
8+
req.once('data', common.mustCall(() => {
9+
req.pause();
10+
res.writeHead(200);
11+
res.end();
12+
res.on('finish', common.mustCall(() => {
13+
assert(!req._dumped);
14+
}));
15+
}));
16+
}));
17+
server.listen(0);
18+
19+
server.on('listening', common.mustCall(function() {
20+
const req = http.request({
21+
port: this.address().port,
22+
method: 'POST',
23+
path: '/'
24+
}, common.mustCall(function(res) {
25+
assert.strictEqual(res.statusCode, 200);
26+
res.resume();
27+
res.on('end', common.mustCall(() => {
28+
server.close();
29+
}));
30+
}));
31+
32+
req.end(Buffer.allocUnsafe(1024));
33+
}));

0 commit comments

Comments
 (0)