Closed dclaar closed 3 years ago
This code is in the m5stack version of urequests, too, but might fail on the redirect:
s.write(b"\r\n")
if data:
s.write(data)
l = s.readline()
#print(l)
l = l.split(None, 2)
status = int(l[1]) <---
This should be the first line that we get back from the HTTP call [RFC2626[(https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#:~:text=6.1%20Status%2DLine,in%20the%20final%20CRLF%20sequence.):
6.1 Status-Line
The first line of a Response message is the Status-Line, consisting of the protocol version followed by a numeric status code and its associated textual phrase, with each element separated by SP characters. No CR or LF is allowed except in the final CRLF sequence.
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
So this seems mandatory!
I pushed some protection against this out. Still don't know what is going on.
Same as issue #14