kopia lustrzana https://github.com/micropython/micropython-lib
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/247pull/236/merge
rodzic
cdea2d94cc
commit
469e029dd2
|
@ -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":
|
||||
|
|
Ładowanie…
Reference in New Issue