Commit 1a40d16
committed
fix(transcode): ignore Content-Length from non-2xx HEAD responses
resolve_file_size() trusted Content-Length unconditionally, so a 405
(or any 4xx/5xx) HEAD response with a short error body (e.g. 18-byte
"Method Not Allowed") set _file_size to that tiny value. The probe
stage then clamped header_size to 18 bytes, logged "Header too small",
and the transcode pipeline returned 404.
Only read Content-Length from HEAD when status < 400; otherwise fall
through to the existing Range: bytes=0-0 GET branch which reads the
real size from Content-Range.
Fixes: upstreams like AIOStreams /api/v1/debrid/playback/ that 405 on HEAD.
Closes #2761 parent 320015c commit 1a40d16
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
0 commit comments