Remove dead code

These check the origin which is already checked in router auth
This commit is contained in:
dasha_uwu
2026-01-16 22:12:20 +05:00
committed by Jason Volk
parent 2f4d3c2851
commit 3a9446bb9c
5 changed files with 2 additions and 84 deletions

View File

@@ -270,21 +270,6 @@ pub(crate) async fn create_join_event_v1_route(
State(services): State<crate::State>,
body: Ruma<create_join_event::v1::Request>,
) -> Result<create_join_event::v1::Response> {
if services
.config
.forbidden_remote_server_names
.is_match(body.origin().host())
{
warn!(
"Server {} tried joining room ID {} through us who has a server name that is \
globally forbidden. Rejecting.",
body.origin(),
&body.room_id,
);
return Err!(Request(Forbidden("Server is banned on this homeserver.")));
}
if let Some(server) = body.room_id.server_name()
&& services
.config
@@ -317,14 +302,6 @@ pub(crate) async fn create_join_event_v2_route(
State(services): State<crate::State>,
body: Ruma<create_join_event::v2::Request>,
) -> Result<create_join_event::v2::Response> {
if services
.config
.forbidden_remote_server_names
.is_match(body.origin().host())
{
return Err!(Request(Forbidden("Server is banned on this homeserver.")));
}
if let Some(server) = body.room_id.server_name()
&& services
.config