gusmobile

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/gusmobile.git
Log | Files | Refs | LICENSE

commit c2be5b45fb0576857cc0a5fe7ef2e5f43a740ae0
parent 8af43d3352e8c5ecab8d2feb8995faf5c09810c1
Author: Natalie Pendragon <natpen@natpen.net>
Date:   Sun, 24 May 2020 07:59:43 -0400

Fail more gracefully on invalid headers

Diffstat:
Mgusmobile/client.py | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/gusmobile/client.py b/gusmobile/client.py @@ -96,6 +96,10 @@ def fetch(raw_url): return # Validate header header_split = header.split(maxsplit=1) + if len(header_split) < 1: + print("ERROR: Received invalid header from server!") + f.close() + return status = header_split[0] if len(header_split) > 1: meta = header_split[1]