Check if username is alphanumeric
This commit is contained in:
parent
c6a8c417ef
commit
30a8894f76
1 changed files with 1 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ async fn main() -> Result<()> {
|
||||||
// we won't process until we find one.
|
// we won't process until we find one.
|
||||||
match framed.next().await {
|
match framed.next().await {
|
||||||
Some(Ok(username)) => {
|
Some(Ok(username)) => {
|
||||||
if !username.is_empty() && username.is_ascii() {
|
if !username.is_empty() && name.chars().all(char::is_alphanumeric) {
|
||||||
name = username.clone();
|
name = username.clone();
|
||||||
db.0.lock().unwrap().insert(username.clone(), address);
|
db.0.lock().unwrap().insert(username.clone(), address);
|
||||||
let message = compose_message(username.clone(), db.clone());
|
let message = compose_message(username.clone(), db.clone());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue