diff --git a/server.py b/server.py index 3c48f0b..ba10b35 100644 --- a/server.py +++ b/server.py @@ -50,13 +50,14 @@ def relay(): elif num >= 2 and not mimetype in ["text/gemini", ""]: for i in gemresponse: gemraw.append(i) - if gemresponse.decode() != "": + if mimetype in ["text/gemini", ""] and gemresponse.decode() != "": received += gemresponse.decode() else: break num+=1 except: return f'\n
The file that the Gemini server sent couldn\'t be decoded by Gem2Browser.
' + print(mimetype) if not mimetype.lower() in ["text/gemini", ""]: return bytes(gemraw) received = received.replace("\r", "")