0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

modules/client/user: Validate user path parameter for now.

This commit is contained in:
Jason Volk 2018-04-08 19:34:20 -07:00
parent 7fb3047f68
commit 37a126915b

View file

@ -42,6 +42,12 @@ get_user(client &client, const resource::request &request)
url::decode(request.parv[0], user_id)
};
if(request.user_id != user_id)
throw m::UNSUPPORTED
{
"Getting user data as someone else is not yet supported"
};
const string_view &cmd
{
request.parv[1]
@ -82,6 +88,12 @@ post_user(client &client, resource::request &request)
url::decode(request.parv[0], user_id)
};
if(request.user_id != user_id)
throw m::UNSUPPORTED
{
"Posting user data as someone else is not yet supported"
};
const string_view &cmd
{
request.parv[1]
@ -122,6 +134,12 @@ put_user(client &client, const resource::request &request)
url::decode(request.parv[0], user_id)
};
if(request.user_id != user_id)
throw m::UNSUPPORTED
{
"Putting user data as someone else is not yet supported"
};
if(request.parv.size() < 2)
throw m::NEED_MORE_PARAMS
{