Update server.py
This commit is contained in:
parent
0f0c06ef3c
commit
9b58562316
1 changed files with 4 additions and 1 deletions
|
@ -90,13 +90,16 @@ def relay():
|
|||
goto = temp.split(" ")[0]
|
||||
prse = urlparse(goto)
|
||||
extra = ""
|
||||
print(goto)
|
||||
if prse.netloc == "" and prse.scheme == "":
|
||||
isdir = url[len(url) - 1] == "/"
|
||||
if isdir:
|
||||
print(url + goto)
|
||||
tempurl = url + goto
|
||||
else:
|
||||
tempurl = "/".join(url.split("/")[:-1]) + "/" + goto
|
||||
goto = f"/gem?gemini={tempurl}"
|
||||
print(goto)
|
||||
elif prse.scheme != "gemini":
|
||||
extra = "<img height=\"6\" src=\"/external.png\">"
|
||||
elif prse.hostname != urlparse(fulladdr).hostname:
|
||||
|
@ -105,7 +108,7 @@ def relay():
|
|||
comment = goto
|
||||
else:
|
||||
comment = " ".join(temp.split(" ")[1:])
|
||||
code += f"<a href=\"{goto}\">{comment} {extra}</a>\n"
|
||||
code += f"<p><a href=\"{goto}\">{comment} {extra}</a></p>\n"
|
||||
else:
|
||||
code += f"<p>{i}</p>\n"
|
||||
if title == "Something went wrong...":
|
||||
|
|
Loading…
Add table
Reference in a new issue