From a33e4fef5a8e6a83e5d13255dbb91921c5ba69a0 Mon Sep 17 00:00:00 2001 From: swee Date: Mon, 13 Jan 2025 21:54:37 -0800 Subject: [PATCH] Update server.py --- server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'\nSomething went wrong...

Something went wrong...

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", "")