diff options
author | stale <redkugelblitzin@gmail.com> | 2022-05-14 06:17:24 -0300 |
---|---|---|
committer | stale <redkugelblitzin@gmail.com> | 2022-05-14 06:17:24 -0300 |
commit | 127a1059fec4fecb4099cb95ddb7ef3c7cf45077 (patch) | |
tree | fe30d16256d76fd3fb5d1238dcfa0071107a5c29 /src | |
parent | 2bebcd6551b3a0b2c725f0b5fa5801dcf2523dba (diff) |
sanitizing, colors
Diffstat (limited to 'src')
-rw-r--r-- | src/conn.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/conn.rs b/src/conn.rs index 9c23592..14777bf 100644 --- a/src/conn.rs +++ b/src/conn.rs @@ -6,6 +6,7 @@ use std::{ use tokio::sync::RwLock; use futures_util::{SinkExt, StreamExt, TryStreamExt, stream::SplitStream}; use warp::ws::{ WebSocket, Message }; +use ammonia; pub async fn lobby(socket: WebSocket, addr: SocketAddr, room: Arc<RwLock<Room>>) { let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel(); @@ -32,7 +33,7 @@ pub async fn lobby(socket: WebSocket, addr: SocketAddr, room: Arc<RwLock<Room>>) let def = "anon".to_string(); if all_fields.is_empty() { def } else { - let n = all_fields.join(" "); + let n = ammonia::clean(&all_fields.join(" ")); if n.is_empty() { def } else { n } } }; |