mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2024-10-01 03:35:38 -04:00
daemon: Intercept well-known requests.
Some clients might try to use homeserver discovery despite being provided with a homeserver and only the local part of a MXID. To hinder them from going around pantalaimon intercept well-known requests and return a 404.
This commit is contained in:
parent
f3107e2d6b
commit
45b823eac6
@ -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.
|
||||
|
||||
|
@ -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),
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user