From 9dce43ef96ee9946a06da65c55ec71444c7cec5f Mon Sep 17 00:00:00 2001 From: swee Date: Sun, 12 Jan 2025 21:51:59 -0800 Subject: [PATCH] Update server.py --- server.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 61d5ebc..76029a8 100644 --- a/server.py +++ b/server.py @@ -1,14 +1,17 @@ #!/usr/bin/python3 import asyncio, traceback -from flask import Flask, request, render_template +from flask import Flask, request, render_template, redirect from hypercorn.config import Config from hypercorn.asyncio import serve app = Flask(__name__) @app.route("/") def root(): return render_template("home.html") -@app.route("/gem/") -def relay(url): +@app.route("/gem") +def relay(): + url = request.args.get('gemini') + if url == None: + return redirect("/") parsed = "

Something went wrong...

\n" title = "Something went wrong..." try: