Skip to content

Commit 6c56de7

Browse files
authored
Merge pull request #200 from adafruit/no-space-after-colon
handle servers that omit a space after a colon in response headers
2 parents 347a527 + 9543728 commit 6c56de7

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
@@ -266,7 +266,8 @@ def _parse_headers(self) -> None:
266266
header = self._readto(b"\r\n")
267267
if not header:
268268
break
269-
title, content = bytes(header).split(b": ", 1)
269+
title, content = bytes(header).split(b":", 1)
270+
content = content.strip()
270271
if title and content:
271272
# enforce that all headers are lowercase
272273
title = str(title, "utf-8").lower()

0 commit comments

Comments
 (0)