0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

modules/client/profile: Duplicate check for client put; extended timeout.

This commit is contained in:
Jason Volk 2018-04-21 17:28:48 -07:00
parent 3d5c8a5a2f
commit bd3e004d70

View file

@ -237,6 +237,17 @@ put__profile(client &client,
request.user_id
};
profile_get(user, param, [&value]
(const string_view &existing)
{
if(existing == value)
throw m::error
{
http::NOT_MODIFIED, "M_NOT_MODIFIED",
"Profile key '%s' already that value"
};
});
const auto eid
{
profile_set(user, sender, param, value)
@ -253,7 +264,8 @@ method_put
{
profile_resource, "PUT", put__profile,
{
method_put.REQUIRES_AUTH
method_put.REQUIRES_AUTH,
60s
}
};