mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 19:38:58 +00:00
pulled out of https://github.com/oven-sh/bun/pull/21809 +7 node tests --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
16 lines
443 B
JavaScript
16 lines
443 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (common.isWindows) return; // TODO: BUN
|
|
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();
|
|
}));
|
|
}));
|