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: