summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conn.rs3
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 }
}
};