urllib.urequest: Support HTTP reply lines without textual description.

E.g. "HTTP/1.1 500". RFC7230 seems to formally require at least a space
after the numeric code, but it was reported that some software sends
lines like above nonetheless.

Ref: https://github.com/micropython/micropython-lib/issues/247
pull/236/merge
Paul Sokolovsky 2018-01-14 11:40:11 +02:00
rodzic cdea2d94cc
commit 469e029dd2
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -45,9 +45,9 @@ def urlopen(url, data=None, method="GET"):
s.write(data)
l = s.readline()
protover, status, msg = l.split(None, 2)
status = int(status)
#print(protover, status, msg)
l = l.split(None, 2)
#print(l)
status = int(l[1])
while True:
l = s.readline()
if not l or l == b"\r\n":