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) {
|
||||
const { signal } = streamInfo.controller;
|
||||
const cleanup = () => (res.end(), closeRequest(streamInfo.controller));
|
||||
const cleanup = () => res.end();
|
||||
|
||||
try {
|
||||
const req = await request(streamInfo.url, {
|
||||
@ -94,6 +94,7 @@ async function handleGenericStream(streamInfo, res) {
|
||||
});
|
||||
|
||||
res.status(req.statusCode);
|
||||
req.body.on('error', () => {});
|
||||
|
||||
for (const [ name, value ] of Object.entries(req.headers))
|
||||
res.setHeader(name, value)
|
||||
|
Loading…
Reference in New Issue
Block a user