Update server.py

This commit is contained in:
Nova Cat 2025-01-12 22:46:09 -08:00
parent cad796a5f4
commit ad9769fe45

View file

@ -44,7 +44,7 @@ def relay():
received = "" received = ""
while True: while True:
gemresponse = gemsocket.recv(2048) gemresponse = gemsocket.recv(2048)
if gemresponse: if gemresponse != "":
received += gemresponse.decode() received += gemresponse.decode()
else: else:
break break
@ -85,7 +85,6 @@ def relay():
title = "gemini://" + url title = "gemini://" + url
except: except:
code += traceback.format_exc() code += traceback.format_exc()
print(code)
return f'<!DOCTYPE html>\n<html><head><meta charset="UTF-8"><link rel="stylesheet" href="https://swee.codes/style.css"><title>{title}</title></head><body>{code}</body></html>' return f'<!DOCTYPE html>\n<html><head><meta charset="UTF-8"><link rel="stylesheet" href="https://swee.codes/style.css"><title>{title}</title></head><body>{code}</body></html>'
# Run the Hypercorn ASGI server # Run the Hypercorn ASGI server