more error checking for deserialising events and canonical JSON
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
c83acabfb0
commit
1a06c8c9d3
3 changed files with 69 additions and 8 deletions
|
@ -1822,8 +1822,10 @@ pub async fn create_invite_route(
|
|||
));
|
||||
}
|
||||
|
||||
let mut signed_event = utils::to_canonical_object(&body.event)
|
||||
.map_err(|_| Error::BadRequest(ErrorKind::InvalidParam, "Invite event is invalid."))?;
|
||||
let mut signed_event = utils::to_canonical_object(&body.event).map_err(|e| {
|
||||
error!("Failed to convert invite event to canonical JSON: {}", e);
|
||||
Error::BadRequest(ErrorKind::InvalidParam, "Invite event is invalid.")
|
||||
})?;
|
||||
|
||||
ruma::signatures::hash_and_sign_event(
|
||||
services().globals.server_name().as_str(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue