urequests: Raise error when server doesn't respond with valid http.

pull/502/head
Andrew Leech 2022-06-20 13:11:35 +10:00 zatwierdzone przez Damien George
rodzic a725c42049
commit dbd8fff830
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -111,6 +111,9 @@ def request(
l = s.readline()
# print(l)
l = l.split(None, 2)
if len(l) < 2:
# Invalid response
raise ValueError("HTTP error: BadStatusLine:\n%s" % l)
status = int(l[1])
reason = ""
if len(l) > 2: