From ac9c73024d21c47aba507e184dda201b7a4e2590 Mon Sep 17 00:00:00 2001 From: swee Date: Mon, 13 Jan 2025 16:13:58 -0800 Subject: [PATCH] Update server.py --- server.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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: