Skip to content

Commit

Permalink
Merge pull request #200 from adafruit/no-space-after-colon
Browse files Browse the repository at this point in the history
handle servers that omit a space after a colon in response headers
  • Loading branch information
FoamyGuy committed Jul 8, 2024
2 parents 347a527 + 9543728 commit 6c56de7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion adafruit_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ def _parse_headers(self) -> None:
header = self._readto(b"\r\n")
if not header:
break
title, content = bytes(header).split(b": ", 1)
title, content = bytes(header).split(b":", 1)
content = content.strip()
if title and content:
# enforce that all headers are lowercase
title = str(title, "utf-8").lower()
Expand Down

0 comments on commit 6c56de7

Please sign in to comment.