stream/internal: don't abort immediately after close for generic streams

This commit is contained in:
dumbmoron 2024-06-23 13:54:43 +00:00
parent f54d2d82cb
commit 6cc1443e1e
No known key found for this signature in database

View File

@ -80,7 +80,7 @@ async function handleYoutubeStream(streamInfo, res) {
async function handleGenericStream(streamInfo, res) { async function handleGenericStream(streamInfo, res) {
const { signal } = streamInfo.controller; const { signal } = streamInfo.controller;
const cleanup = () => (res.end(), closeRequest(streamInfo.controller)); const cleanup = () => res.end();
try { try {
const req = await request(streamInfo.url, { const req = await request(streamInfo.url, {
@ -94,6 +94,7 @@ async function handleGenericStream(streamInfo, res) {
}); });
res.status(req.statusCode); res.status(req.statusCode);
req.body.on('error', () => {});
for (const [ name, value ] of Object.entries(req.headers)) for (const [ name, value ] of Object.entries(req.headers))
res.setHeader(name, value) res.setHeader(name, value)