Update server.py
This commit is contained in:
parent
dc992dbc5a
commit
ac9c73024d
1 changed files with 7 additions and 4 deletions
11
server.py
11
server.py
|
@ -34,7 +34,7 @@ def crosserver():
|
|||
return send_file("cross-server.png")
|
||||
@app.route("/style.css")
|
||||
def style():
|
||||
return send_file("cross-server.png")
|
||||
return send_file("style.css")
|
||||
@app.route("/gem")
|
||||
def relay():
|
||||
url = request.args.get('gemini')
|
||||
|
@ -86,7 +86,7 @@ def relay():
|
|||
temp = i[2:]
|
||||
code += f"<ul><li>{temp}</li></ul>\n"
|
||||
elif i[0:2] == "=>":
|
||||
temp = i[2:].strip()
|
||||
temp = " ".join(i[2:].replace(" ", " ").split(" "))
|
||||
goto = temp.split(" ")[0]
|
||||
prse = urlparse(goto)
|
||||
extra = ""
|
||||
|
@ -102,8 +102,11 @@ def relay():
|
|||
print(goto)
|
||||
elif prse.scheme != "gemini":
|
||||
extra = "<img height=\"6\" src=\"/external.png\">"
|
||||
elif prse.hostname != urlparse(fulladdr).hostname:
|
||||
extra = "<img height=\"6\" src=\"/cross-server.png\">"
|
||||
else:
|
||||
if prse.hostname != urlparse(fulladdr).hostname:
|
||||
extra = "<img height=\"6\" src=\"/cross-server.png\">"
|
||||
goto = goto.replace("gemini://", "")
|
||||
goto = f"/gem?gemini={goto}"
|
||||
if temp.split(" ") == 1:
|
||||
comment = goto
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue