Get tough on non-standard status codes!

This commit is contained in:
Solderpunk 2019-08-13 20:40:14 +03:00
parent 8dd08fa609
commit 242cf484f0
1 changed files with 1 additions and 1 deletions

View File

@ -255,7 +255,7 @@ Slow internet connection? Use 'set timeout' to be more patient.""")
# Validate header
status, meta = header.split(maxsplit=1)
if len(header) > 1024 or len(status) > 2 or not status.isnumeric():
if len(header) > 1024 or len(status) != 2 or not status.isnumeric():
print("ERROR: Received invalid header from server!")
f.close()
return