Update server.py

This commit is contained in:
Nova Cat 2025-01-13 21:53:30 -08:00
parent e0970523ad
commit 81dd648e35

View file

@ -38,14 +38,14 @@ def relay():
while True:
gemresponse = gemsocket.recv(2048)
try:
if num = 0:
if num == 0:
try:
mimetype = gemresponse.decode().replace("\r","").split("\n")[0].split(" ")[1].split(";")[0]
if mimetype != "text/gemini".lower() and gemresponse.decode().replace("\r","").split("\n")[0].split(" ")[0][0] != "2":
print("Non-ordinary type! " + mimetype)
except:
pass
elif num = 1 and not mimetype in ["text/gemini", ""]:
elif num == 1 and not mimetype in ["text/gemini", ""]:
pass
elif num >= 2 and not mimetype in ["text/gemini", ""]:
for i in gemresponse: