Update server.py
This commit is contained in:
parent
e0970523ad
commit
81dd648e35
1 changed files with 2 additions and 2 deletions
|
@ -38,14 +38,14 @@ def relay():
|
||||||
while True:
|
while True:
|
||||||
gemresponse = gemsocket.recv(2048)
|
gemresponse = gemsocket.recv(2048)
|
||||||
try:
|
try:
|
||||||
if num = 0:
|
if num == 0:
|
||||||
try:
|
try:
|
||||||
mimetype = gemresponse.decode().replace("\r","").split("\n")[0].split(" ")[1].split(";")[0]
|
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":
|
if mimetype != "text/gemini".lower() and gemresponse.decode().replace("\r","").split("\n")[0].split(" ")[0][0] != "2":
|
||||||
print("Non-ordinary type! " + mimetype)
|
print("Non-ordinary type! " + mimetype)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
elif num = 1 and not mimetype in ["text/gemini", ""]:
|
elif num == 1 and not mimetype in ["text/gemini", ""]:
|
||||||
pass
|
pass
|
||||||
elif num >= 2 and not mimetype in ["text/gemini", ""]:
|
elif num >= 2 and not mimetype in ["text/gemini", ""]:
|
||||||
for i in gemresponse:
|
for i in gemresponse:
|
||||||
|
|
Loading…
Add table
Reference in a new issue