Skip to content

Commit

Permalink
Merge pull request #17 from ladyada/master
Browse files Browse the repository at this point in the history
fix parsing error on lines like `b'X-Geo-Block-List:'` as received by github
  • Loading branch information
jepler committed Jan 25, 2020
2 parents 715c2fe + 4ca272a commit 9d75832
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion adafruit_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ def parse_headers(sock):
break

#print("**line: ", line)
title, content = line.split(b': ', 1)
splits = line.split(b': ', 1)
title = splits[0]
content = ''
if len(splits) > 1:
content = splits[1]
if title and content:
title = str(title.lower(), 'utf-8')
content = str(content, 'utf-8')
Expand Down

0 comments on commit 9d75832

Please sign in to comment.