mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
return an error when attempting to delete a nonexistent local alias
The spec doesn't spell out explicitly that the server should check this, but it does list M_NOT_FOUND "room alias ... not found" as an example error response.
This commit is contained in:
parent
a34bca3986
commit
5f9e85cb49
2 changed files with 9 additions and 0 deletions
|
|
@ -75,6 +75,13 @@ pub(crate) async fn delete_alias_route(
|
|||
));
|
||||
}
|
||||
|
||||
if services().rooms.alias.resolve_local_alias(&body.room_alias)?.is_none() {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::NotFound,
|
||||
"Alias is not assigned.",
|
||||
));
|
||||
}
|
||||
|
||||
if let Some(info) = &body.appservice_info {
|
||||
if !info.aliases.is_match(body.room_alias.as_str()) {
|
||||
return Err(Error::BadRequest(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue