httpserver, Fediverse: show an error message on 404

This commit is contained in:
Valentin Lorentz 2021-04-18 16:25:37 +02:00
parent a209b73248
commit c7d85e73d7
2 changed files with 4 additions and 1 deletions

View File

@ -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()

View File

@ -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()}