Accept Incorrectly Capitalized Content-Range Headers

Some external podcast urls return a valid CDN response, which is not accepted due to the "Content-Range" header being all lowercase as "content-range". This tries the lowercase version of the header as a backup if no Content-Range header is found initially.
This commit is contained in:
Googolplexed
2025-07-28 18:51:10 -05:00
committed by GitHub
parent 2782d23c7d
commit 4f796e640c

View File

@@ -578,6 +578,8 @@ class CdnManager:
response = self.request(range_start=0,
range_end=ChannelManager.chunk_size - 1)
content_range = response.headers.get("Content-Range")
if content_range is None:
content_range = response.headers.get("content-range")
if content_range is None:
raise IOError("Missing Content-Range header!")
split = content_range.split("/")