From 127a1059fec4fecb4099cb95ddb7ef3c7cf45077 Mon Sep 17 00:00:00 2001 From: stale Date: Sat, 14 May 2022 06:17:24 -0300 Subject: sanitizing, colors --- src/conn.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/conn.rs') 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>) { let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel(); @@ -32,7 +33,7 @@ pub async fn lobby(socket: WebSocket, addr: SocketAddr, room: Arc>) 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 } } }; -- cgit v1.2.3