From c7d85e73d7b49e216e6659a8002e796641abfa79 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 18 Apr 2021 16:25:37 +0200 Subject: [PATCH] httpserver, Fediverse: show an error message on 404 --- plugins/Fediverse/plugin.py | 4 +++- src/httpserver.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Fediverse/plugin.py b/plugins/Fediverse/plugin.py index 695c3b502..7ce6fd1ab 100644 --- a/plugins/Fediverse/plugin.py +++ b/plugins/Fediverse/plugin.py @@ -61,7 +61,9 @@ class FediverseHttp(httpserver.SupyHTTPServerCallback): if path == "/instance_actor": self.instance_actor(write_content) else: - assert False, repr(path) + self.send_response(404) + self.end_headers() + self.wfile.write(b"Error 404. There is nothing to see here.") def doWellKnown(self, handler, path): actor_url = ap.get_instance_actor_url() diff --git a/src/httpserver.py b/src/httpserver.py index 97a6f8ab8..6a717a128 100644 --- a/src/httpserver.py +++ b/src/httpserver.py @@ -399,6 +399,7 @@ class SupyWellKnown(SupyHTTPServerCallback): handler.send_response(404) self.end_headers() + self.wfile.write(b"Error 404. There is nothing to see here.") DEFAULT_CALLBACKS = {'.well-known': SupyWellKnown()}