Skip to content

Commit 4f796e6

Browse files
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.
1 parent 2782d23 commit 4f796e6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

librespot/audio/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,8 @@ def __init__(self, session: Session, stream_id: StreamId,
578578
response = self.request(range_start=0,
579579
range_end=ChannelManager.chunk_size - 1)
580580
content_range = response.headers.get("Content-Range")
581+
if content_range is None:
582+
content_range = response.headers.get("content-range")
581583
if content_range is None:
582584
raise IOError("Missing Content-Range header!")
583585
split = content_range.split("/")

0 commit comments

Comments
 (0)