fix(anime): never forward Range to the bridge so 206 replies cannot skip the strip

ffmpeg opens every HLS segment with 'Range: bytes=0-'. The bridge
answers some of those 206 (depending on its cache state), and the proxy
only rewrites full 200 bodies, so the PNG disguise passed through
untouched and whether an episode played was a coin flip: first attempts
died with "no audio or video data played", the same URL played fine
once the bridge had the segments cached.

Reproduced end to end against a private bridge + mpv driven with the
app's exact commands; with Range dropped every segment is stripped and
playback runs.
This commit is contained in:
2026-08-01 00:40:34 -07:00
parent df4c20e971
commit 9d6dc7720b
3 changed files with 42 additions and 0 deletions
+5
View File
@@ -119,6 +119,11 @@ export function startStreamStripProxy(
const requestHeaders = forwardableHeaders(req.headers);
delete requestHeaders.host;
// Never forward Range: ffmpeg opens every segment with `bytes=0-`, the
// bridge answers some of those 206, and a partial response cannot be
// stripped (only full 200 bodies are). Byte ranges into a resource whose
// bytes this proxy rewrites would be incoherent anyway.
delete requestHeaders.range;
res.on('error', () => {});
requestUpstream(req, res, upstreamUrl, requestHeaders, 0);