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:
June Clementine Strawberry committed 2025-04-06 15:25:19 -04:00
1 parent ff276a42a3
commit d5ad973464
13 files changed
+79 -71

No files matched your search

+2 -4
View File
@@ -42,10 +42,9 @@ pub(crate) async fn create_join_event_template_route(
.await?;
if services
.server
.config
.forbidden_remote_server_names
.contains(body.origin())
.is_match(body.origin().host())
{
warn!(
"Server {} for remote user {} tried joining room ID {} which has a server name that \
@@ -59,10 +58,9 @@ pub(crate) async fn create_join_event_template_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(warn!(
"Room ID server name {server} is banned on this homeserver."