Update server.py
This commit is contained in:
parent
43804248bd
commit
c119ccfd4b
1 changed files with 1 additions and 1 deletions
|
@ -55,6 +55,7 @@ def relay():
|
||||||
else:
|
else:
|
||||||
gemcontent_binary.append(i)
|
gemcontent_binary.append(i)
|
||||||
if "\n" in bytes(mtype).decode() and not found:
|
if "\n" in bytes(mtype).decode() and not found:
|
||||||
|
found = True
|
||||||
ok = bytes(mtype).decode().split(" ")[0][0] == "2"
|
ok = bytes(mtype).decode().split(" ")[0][0] == "2"
|
||||||
mimetype = bytes(mtype).decode().replace("\r", "").split("\n")[0].split(" ")[1].split(";")[0]
|
mimetype = bytes(mtype).decode().replace("\r", "").split("\n")[0].split(" ")[1].split(";")[0]
|
||||||
except:
|
except:
|
||||||
|
@ -65,7 +66,6 @@ def relay():
|
||||||
binary = True
|
binary = True
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
if binary:
|
if binary:
|
||||||
print(gemcontent_binary)
|
|
||||||
return Response(bytes(gemcontent_binary), mimetype="text/gemini" if mimetype=="" else mimetype)
|
return Response(bytes(gemcontent_binary), mimetype="text/gemini" if mimetype=="" else mimetype)
|
||||||
received = received.replace("\r", "")
|
received = received.replace("\r", "")
|
||||||
firstline = True
|
firstline = True
|
||||||
|
|
Loading…
Add table
Reference in a new issue