mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-12 19:56:48 +00:00
fix: Return 405 when setting m.fully_read via account data
The spec requires servers to reject client writes to server-managed account data types with 405 M_BAD_JSON. We returned 400.
This commit is contained in:
1 parent
219e8d2e1e
commit
223e889459
2 files changed
+8
-4
No files matched your search
@@ -0,0 +1 @@
|
||||
Setting `m.fully_read` via the account data endpoints now returns 405 `M_BAD_JSON` as required by the spec, instead of 400.
|
||||
@@ -117,10 +117,13 @@ async fn set_account_data(
|
||||
data: &RawJsonValue,
|
||||
) -> Result {
|
||||
if event_type_s == "m.fully_read" {
|
||||
return Err!(Request(BadJson(
|
||||
"This endpoint cannot be used for marking a room as fully read (setting \
|
||||
m.fully_read)"
|
||||
)));
|
||||
return Err!(Request(
|
||||
BadJson(
|
||||
"This endpoint cannot be used for marking a room as fully read (setting \
|
||||
m.fully_read)"
|
||||
),
|
||||
METHOD_NOT_ALLOWED
|
||||
));
|
||||
}
|
||||
|
||||
let data: serde_json::Value = serde_json::from_str(data.get())
|
||||
|
||||
Reference in new issue
Block a user