From 9177e44adb5ecf10c8ae3cede06a7ed583273712 Mon Sep 17 00:00:00 2001 From: Skye Date: Mon, 5 Jun 2023 01:54:33 +0900 Subject: [PATCH] fix: this was actually quite a big footgun --- server/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index a9d255f..a602f59 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -168,7 +168,7 @@ async fn accept_websocket_connection(stream: TcpStream) -> Result<()> { info!("New WebSocket connection: {}", addr); - let domain = get_random_domain().await; + let domain = get_random_domain().await.to_lowercase(); ws_stream .send(ClientboundControlMessage::DomainAssigned(domain.clone()).into()) @@ -366,7 +366,7 @@ async fn accept_minecraft_connection(mut stream: TcpStream) -> Result<()> { let handshake = Handshake::new(&packet?).await?; info!("Minecraft client {} is connecting to {}", addr, handshake.server_address); let map = ROUTING_MAP.read().await; - if let Some(sender) = map.get(&handshake.server_address).cloned() { + if let Some(sender) = map.get(&handshake.server_address.to_lowercase()).cloned() { drop(map); let mut handle: ChannelHandle = ChannelHandle::new(&sender, addr).await?; let mut buf = vec![];