Update server.py
This commit is contained in:
parent
aadf3a65fc
commit
11beb3a822
1 changed files with 7 additions and 4 deletions
11
server.py
11
server.py
|
@ -51,10 +51,13 @@ def relay():
|
||||||
received = ""
|
received = ""
|
||||||
while True:
|
while True:
|
||||||
gemresponse = gemsocket.recv(2048)
|
gemresponse = gemsocket.recv(2048)
|
||||||
if gemresponse.decode() != "":
|
try:
|
||||||
received += gemresponse.decode()
|
if gemresponse.decode() != "":
|
||||||
else:
|
received += gemresponse.decode()
|
||||||
break
|
else:
|
||||||
|
break
|
||||||
|
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\' be decoded by Gem2Browser.</p></body></html>'
|
||||||
received = received.replace("\r", "")
|
received = received.replace("\r", "")
|
||||||
firstline = True
|
firstline = True
|
||||||
redirected = False
|
redirected = False
|
||||||
|
|
Loading…
Add table
Reference in a new issue