api/stream: don't override content-length for hls transform

This commit is contained in:
jj 2024-10-28 11:55:15 +00:00
parent 6b1eadbe09
commit 53e6085095
No known key found for this signature in database

View file

@ -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();