From 53e6085095cbfb4d23d2f993242b2bdc0026ce84 Mon Sep 17 00:00:00 2001 From: jj Date: Mon, 28 Oct 2024 11:55:15 +0000 Subject: [PATCH] api/stream: don't override content-length for hls transform --- api/src/stream/internal.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/src/stream/internal.js b/api/src/stream/internal.js index 4235d722..48fa124c 100644 --- a/api/src/stream/internal.js +++ b/api/src/stream/internal.js @@ -96,8 +96,11 @@ 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) + for (const [ name, value ] of Object.entries(req.headers)) { + if (!isHlsRequest(req) || name.toLowerCase() !== 'content-length') { + res.setHeader(name, value); + } + } if (req.statusCode < 200 || req.statusCode > 299) return cleanup();