Skip to content

Commit 9543728

Browse files
committed
handle servers that omit a space after a colon in response headers
1 parent 4b55319 commit 9543728

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_requests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ def _parse_headers(self) -> None:
251251
header = self._readto(b"\r\n")
252252
if not header:
253253
break
254-
title, content = bytes(header).split(b": ", 1)
254+
title, content = bytes(header).split(b":", 1)
255+
content = content.strip()
255256
if title and content:
256257
# enforce that all headers are lowercase
257258
title = str(title, "utf-8").lower()

0 commit comments

Comments
 (0)