Update server.py
This commit is contained in:
parent
81dd648e35
commit
a33e4fef5a
1 changed files with 2 additions and 1 deletions
|
@ -50,13 +50,14 @@ def relay():
|
|||
elif num >= 2 and not mimetype in ["text/gemini", ""]:
|
||||
for i in gemresponse:
|
||||
gemraw.append(i)
|
||||
if gemresponse.decode() != "":
|
||||
if mimetype in ["text/gemini", ""] and gemresponse.decode() != "":
|
||||
received += gemresponse.decode()
|
||||
else:
|
||||
break
|
||||
num+=1
|
||||
except:
|
||||
return f'<!DOCTYPE html>\n<html><head><meta charset="UTF-8"><link rel="stylesheet" href="/style.css"><title>Something went wrong...</title></head><body><h1>Something went wrong...</h1><p>The file that the Gemini server sent couldn\'t be decoded by Gem2Browser.</p></body></html>'
|
||||
print(mimetype)
|
||||
if not mimetype.lower() in ["text/gemini", ""]:
|
||||
return bytes(gemraw)
|
||||
received = received.replace("\r", "")
|
||||
|
|
Loading…
Add table
Reference in a new issue