mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
modules/media/download: Add the deprecated /v1/ url handler for Riot.
This commit is contained in:
parent
e67ce2b43e
commit
5c5a5d3c83
1 changed files with 27 additions and 15 deletions
|
@ -10,28 +10,35 @@
|
||||||
|
|
||||||
using namespace ircd;
|
using namespace ircd;
|
||||||
|
|
||||||
mapi::header IRCD_MODULE
|
mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
{
|
{
|
||||||
"media download"
|
"11.7 :Content repository (download)"
|
||||||
};
|
};
|
||||||
|
|
||||||
struct send
|
resource
|
||||||
:resource
|
|
||||||
{
|
|
||||||
using resource::resource;
|
|
||||||
}
|
|
||||||
download_resource
|
download_resource
|
||||||
{
|
{
|
||||||
"/_matrix/media/r0/download/", resource::opts
|
"/_matrix/media/r0/download/",
|
||||||
{
|
{
|
||||||
"media download",
|
"(11.7.1.2) download",
|
||||||
|
resource::DIRECTORY,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
resource
|
||||||
|
download_resource__legacy
|
||||||
|
{
|
||||||
|
"/_matrix/media/v1/download/",
|
||||||
|
{
|
||||||
|
"(11.7.1.2) download (legacy)",
|
||||||
resource::DIRECTORY,
|
resource::DIRECTORY,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
resource::response
|
resource::response
|
||||||
handle_get(client &client,
|
get__download(client &client,
|
||||||
const resource::request &request)
|
const resource::request &request)
|
||||||
{
|
{
|
||||||
if(request.parv.size() < 2)
|
if(request.parv.size() < 2)
|
||||||
throw http::error
|
throw http::error
|
||||||
|
@ -66,9 +73,14 @@ handle_get(client &client,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
resource::method method_put
|
resource::method
|
||||||
|
method_get
|
||||||
{
|
{
|
||||||
download_resource, "GET", handle_get,
|
download_resource, "GET", get__download
|
||||||
{
|
};
|
||||||
}
|
|
||||||
|
resource::method
|
||||||
|
method_get__legacy
|
||||||
|
{
|
||||||
|
download_resource__legacy, "GET", get__download
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue