diff --git a/server.py b/server.py index 001e71c..a9692cd 100644 --- a/server.py +++ b/server.py @@ -51,10 +51,13 @@ def relay(): received = "" while True: gemresponse = gemsocket.recv(2048) - if gemresponse.decode() != "": - received += gemresponse.decode() - else: - break + try: + if gemresponse.decode() != "": + received += gemresponse.decode() + else: + break + except: + return f'\n
The file that the Gemini server sent couldn\' be decoded by Gem2Browser.
' received = received.replace("\r", "") firstline = True redirected = False