mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 19:28:29 +00:00
stream/internal: don't abort immediately after close for generic streams
This commit is contained in:
parent
f54d2d82cb
commit
6cc1443e1e
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user