0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

modules/client/profile: Return 200 rather than 304 for put profile dups.

This commit is contained in:
Jason Volk 2018-04-26 03:35:38 -07:00
parent 0df06b0b62
commit e6b06a4522

View file

@ -237,17 +237,19 @@ put__profile(client &client,
request.user_id
};
user.profile(std::nothrow, param, [&value]
bool modified{true};
user.profile(std::nothrow, param, [&value, &modified]
(const string_view &existing)
{
if(existing == value)
throw m::error
{
http::NOT_MODIFIED, "M_NOT_MODIFIED",
"Profile key '%s' already that value"
};
modified = existing != value;
});
if(!modified)
return resource::response
{
client, http::OK
};
const auto eid
{
profile_set(user, sender, param, value)