diff --git a/api.py b/api.py index 20363b9..0090f62 100644 --- a/api.py +++ b/api.py @@ -1,4 +1,4 @@ -from fastapi import FastAPI, Request, HTTPException +from fastapi import FastAPI, Request, HTTPException, responses import sqlite3 from hashlib import sha256 from fastapi.templating import Jinja2Templates @@ -55,6 +55,8 @@ def blocked(domain: str = None): @app.get(base_url+"/") def index(request: Request, domain: str = None): + if domain == "": + return responses.RedirectResponse("/") blocks = get(f"http://127.0.0.1:8069{base_url}/api?domain={domain}") info = None if domain == None: diff --git a/index.html b/index.html index 607ca73..05c4091 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,6 @@ - fedi-block-api {{domain}} + fedi-block-api{% if domain %} {{domain}}{% endif %}