Merge pull request 'Fix: ValueError if MIME is empty string (like a #20)' (#42) from continue/AV-98:fix-empty-mime into master

Reviewed-on: #42
This commit is contained in:
Solderpunk 2023-11-12 10:12:37 +00:00
commit cb1cbfec85
1 changed files with 1 additions and 1 deletions

View File

@ -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!")