mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 04:37:00 +00:00
fix: Return M_PROFILE_TOO_LARGE for oversize profiles
Profile updates that would push the profile over 64 KiB were rejected with an untyped error, producing a 500. The spec requires 400 M_PROFILE_TOO_LARGE, which ruma now provides.
This commit is contained in:
1 parent
42609eab02
commit
4d0ccd998f
2 files changed
+3
-2
No files matched your search
@@ -0,0 +1 @@
|
||||
Setting profile data that would make the profile exceed 64 KiB now returns 400 `M_PROFILE_TOO_LARGE` as required by the spec, instead of a 500 error.
|
||||
@@ -80,10 +80,10 @@ impl super::Service {
|
||||
.len()
|
||||
> MAX_PROFILE_LENGTH_BYTES
|
||||
{
|
||||
return Err!(
|
||||
return Err!(Request(ProfileTooLarge(
|
||||
"Profile data must not exceed {MAX_PROFILE_LENGTH_BYTES} bytes in \
|
||||
length."
|
||||
);
|
||||
)));
|
||||
}
|
||||
} else {
|
||||
return Err!(Request(BadJson("Failed to canonicalize profile.")));
|
||||
|
||||
Reference in new issue
Block a user