diff --git a/changelog.d/2451.bugfix.2.md b/changelog.d/2451.bugfix.2.md new file mode 100644 index 000000000..49cf46a52 --- /dev/null +++ b/changelog.d/2451.bugfix.2.md @@ -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. diff --git a/src/service/users/profile.rs b/src/service/users/profile.rs index b2c0c3e3b..cad67765c 100644 --- a/src/service/users/profile.rs +++ b/src/service/users/profile.rs @@ -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.")));