diff --git a/main.py b/main.py index 8f9961c..2d884a1 100644 --- a/main.py +++ b/main.py @@ -149,6 +149,13 @@ async def simpleer_search(query, page): @app.route("//") async def instance(domain): + # favicon.ico is not a domain name + if domain == "favicon.ico": + return await render_template( + "error.html", + error_number = "404", + error_reason = "We don't have a favicon yet. If you would like to contribute one, please send it to ~metalune/public-inbox@lists.sr.ht" + ), 404 return redirect("/" + domain + "/videos/trending") @app.route("//videos/local", defaults = {"page": 1}) diff --git a/templates/error.html b/templates/error.html new file mode 100644 index 0000000..7d8f4c5 --- /dev/null +++ b/templates/error.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block title %}ERROR: {% endblock %} + +{% block content %} +

Error {{ error_number }}

+

{{ error_reason }}

+{% endblock %}