diff --git a/server.py b/server.py index 2141fa3..eb3b1a0 100644 --- a/server.py +++ b/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"\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 = "" - elif prse.hostname != urlparse(fulladdr).hostname: - extra = "" + else: + if prse.hostname != urlparse(fulladdr).hostname: + extra = "" + goto = goto.replace("gemini://", "") + goto = f"/gem?gemini={goto}" if temp.split(" ") == 1: comment = goto else: