diff --git a/pantalaimon/daemon.py b/pantalaimon/daemon.py index f7679d7..c2e2ba8 100755 --- a/pantalaimon/daemon.py +++ b/pantalaimon/daemon.py @@ -987,6 +987,14 @@ class ProxyDaemon: return web.json_response(result, headers=CORS_HEADERS, status=200) + async def well_known(self, _): + """Intercept well-known requests + + Clients might make this request before logging in and override the + homeserver setting set by the user. + """ + return web.Response(status=404) + async def shutdown(self, _): """Shut the daemon down closing all the client sessions it has. diff --git a/pantalaimon/main.py b/pantalaimon/main.py index 9aa6dfd..4b7e384 100644 --- a/pantalaimon/main.py +++ b/pantalaimon/main.py @@ -70,6 +70,8 @@ async def init(data_dir, server_conf, send_queue, recv_queue): proxy.send_message, ), web.post("/_matrix/client/r0/user/{user_id}/filter", proxy.filter), + web.post("/.well-known/matrix/client", proxy.well_known), + web.get("/.well-known/matrix/client", proxy.well_known), web.post("/_matrix/client/r0/search", proxy.search), web.options("/_matrix/client/r0/search", proxy.search_opts), ]