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