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:
parent
3d5c8a5a2f
commit
bd3e004d70
1 changed files with 13 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue