Update server.py

This commit is contained in:
Nova Cat 2025-01-14 15:42:03 -08:00
parent d7228ccc13
commit 8a19ff1828

View file

@ -46,18 +46,17 @@ def relay():
else:
break
found = False
gemraw = bytes(gemraw)
gemcontent_binary = bytearray()
mtype = bytearray()
for i in gemraw:
for i in bytes(gemraw):
try:
if not found:
mtype += i
else:
gemcontent_binary += i
if "\n" in bytes(mtype).decode() and not found:
ok = bytes(mtype).decode().split(" ")[0][0] == "2"
mimetype = bytes(mtype).decode().split(" ")[1].split(";")[0]
elif found:
gemcontent_binary += i
except:
binary = True
print(traceback.format_exc())