change forbidden_server_names and etc to allow regex patterns for wildcards
Signed-off-by: June Clementine Strawberry <june@3.dog>
This commit is contained in:
parent
ff276a42a3
commit
d5ad973464
13 changed files with 79 additions and 71 deletions
|
@ -38,20 +38,18 @@ pub(crate) async fn create_invite_route(
|
|||
|
||||
if let Some(server) = body.room_id.server_name() {
|
||||
if services
|
||||
.server
|
||||
.config
|
||||
.forbidden_remote_server_names
|
||||
.contains(&server.to_owned())
|
||||
.is_match(server.host())
|
||||
{
|
||||
return Err!(Request(Forbidden("Server is banned on this homeserver.")));
|
||||
}
|
||||
}
|
||||
|
||||
if services
|
||||
.server
|
||||
.config
|
||||
.forbidden_remote_server_names
|
||||
.contains(body.origin())
|
||||
.is_match(body.origin().host())
|
||||
{
|
||||
warn!(
|
||||
"Received federated/remote invite from banned server {} for room ID {}. Rejecting.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue