Skip to content

Commit 469e029

Browse files
committed
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: micropython#247
1 parent cdea2d9 commit 469e029

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

urllib.urequest/urllib/urequest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ def urlopen(url, data=None, method="GET"):
4545
s.write(data)
4646

4747
l = s.readline()
48-
protover, status, msg = l.split(None, 2)
49-
status = int(status)
50-
#print(protover, status, msg)
48+
l = l.split(None, 2)
49+
#print(l)
50+
status = int(l[1])
5151
while True:
5252
l = s.readline()
5353
if not l or l == b"\r\n":

0 commit comments

Comments
 (0)