mirror of
https://github.com/nodejs/node.git
synced 2025-04-30 23:56:58 +00:00

Attempted to fix the issue by watering down the condition being checked in internal/streams/utils isWritableNodeStream utility Fixes: https://github.com/nodejs/node/issues/44188 PR-URL: https://github.com/nodejs/node/pull/45642 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
30 lines
648 B
JavaScript
30 lines
648 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const { Writable } = require('stream');
|
|
|
|
const assert = require('assert');
|
|
const http = require('http');
|
|
|
|
// Check if Writable.toWeb works on the response object after creating a server.
|
|
const server = http.createServer(
|
|
common.mustCall((req, res) => {
|
|
const webStreamResponse = Writable.toWeb(res);
|
|
assert.strictEqual(webStreamResponse instanceof WritableStream, true);
|
|
res.end();
|
|
})
|
|
);
|
|
|
|
server.listen(
|
|
0,
|
|
common.mustCall(() => {
|
|
http.get(
|
|
{
|
|
port: server.address().port,
|
|
},
|
|
common.mustCall(() => {
|
|
server.close();
|
|
})
|
|
);
|
|
})
|
|
);
|