Remove dead code

These check the origin which is already checked in router auth
This commit is contained in:
dasha_uwu authored and Jason Volk committed 2026-01-19 00:53:33 +00:00
1 parent 2f4d3c2851
commit 3a9446bb9c
5 files changed
+2 -84

No files matched your search

+1 -16
View File
@@ -6,7 +6,7 @@ use ruma::{
api::{client::error::ErrorKind, federation::membership::prepare_knock_event},
events::room::member::{MembershipState, RoomMemberEventContent},
};
use tuwunel_core::{Err, Error, Result, at, debug_warn, matrix::pdu::PduBuilder, warn};
use tuwunel_core::{Err, Error, Result, at, debug_warn, matrix::pdu::PduBuilder};
use crate::Ruma;
@@ -31,21 +31,6 @@ pub(crate) async fn create_knock_event_template_route(
.acl_check(body.origin(), &body.room_id)
.await?;
if services
.config
.forbidden_remote_server_names
.is_match(body.origin().host())
{
warn!(
"Server {} for remote user {} tried knocking room ID {} which has a server name \
that is globally forbidden. Rejecting.",
body.origin(),
&body.user_id,
&body.room_id,
);
return Err!(Request(Forbidden("Server is banned on this homeserver.")));
}
if let Some(server) = body.room_id.server_name()
&& services
.config