From 4f796e640c953dd544d5f36512307c386d3ee67e Mon Sep 17 00:00:00 2001 From: Googolplexed <65880807+Googolplexed0@users.noreply.github.com> Date: Mon, 28 Jul 2025 18:51:10 -0500 Subject: [PATCH] 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. --- librespot/audio/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/librespot/audio/__init__.py b/librespot/audio/__init__.py index 423c59c..97c9282 100644 --- a/librespot/audio/__init__.py +++ b/librespot/audio/__init__.py @@ -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("/")