Update server.py

This commit is contained in:
Nova Cat 2025-01-14 15:51:03 -08:00
parent 43804248bd
commit c119ccfd4b

View file

@ -55,6 +55,7 @@ def relay():
else:
gemcontent_binary.append(i)
if "\n" in bytes(mtype).decode() and not found:
found = True
ok = bytes(mtype).decode().split(" ")[0][0] == "2"
mimetype = bytes(mtype).decode().replace("\r", "").split("\n")[0].split(" ")[1].split(";")[0]
except:
@ -65,7 +66,6 @@ def relay():
binary = True
print(traceback.format_exc())
if binary:
print(gemcontent_binary)
return Response(bytes(gemcontent_binary), mimetype="text/gemini" if mimetype=="" else mimetype)
received = received.replace("\r", "")
firstline = True