Fix: ValueError if MIME is empty string (like a #20)
This commit is contained in:
parent
265a69a6ed
commit
22c7efce7c
2
av98.py
2
av98.py
|
@ -428,7 +428,7 @@ you'll be able to transparently follow links to Gopherspace!""")
|
|||
self._debug("Response header: %s." % header)
|
||||
|
||||
# Validate header
|
||||
status, meta = header.split(maxsplit=1)
|
||||
status, meta = header.split(maxsplit=1) if header[2:].strip() else (header[:2], "")
|
||||
if len(meta) > 1024 or len(status) != 2 or not status.isnumeric():
|
||||
f.close()
|
||||
raise RuntimeError("Received invalid header from server!")
|
||||
|
|
Loading…
Reference in New Issue