mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
7b26322f6d
Fixes: https://github.com/nodejs/node/issues/33734 PR-URL: https://github.com/nodejs/node/pull/34913 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
15 lines
400 B
JavaScript
15 lines
400 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const http = require('http');
|
|
|
|
const server = http.createServer((req, res) => res.flushHeaders());
|
|
|
|
server.listen(common.mustCall(() => {
|
|
const req =
|
|
http.get({ port: server.address().port }, common.mustCall((res) => {
|
|
res.on('timeout', common.mustCall(() => req.destroy()));
|
|
res.setTimeout(1);
|
|
server.close();
|
|
}));
|
|
}));
|