main: Add the v1 media endpoints.

This uses the same logic as the r0 enpdpoints but some clients might be
stuck using the v1 ones.
This commit is contained in:
Damir Jelić 2020-04-22 11:25:02 +02:00
parent 4b6b61c4be
commit 9e53315540

View File

@ -74,6 +74,13 @@ async def init(data_dir, server_conf, send_queue, recv_queue):
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),
web.get(
"/_matrix/media/v1/download/{server_name}/{media_id}", proxy.download
),
web.get(
"/_matrix/media/v1/download/{server_name}/{media_id}/{file_name}",
proxy.download,
),
web.get(
"/_matrix/media/r0/download/{server_name}/{media_id}", proxy.download
),