From ca77c792222af5c8da50f36b9f4e06526bcb1548 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Wed, 27 May 2020 07:09:23 +0200 Subject: [PATCH] fix: /register lowercases user ids fixes #24 --- src/client_server.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client_server.rs b/src/client_server.rs index 1cbb8399..6812fdde 100644 --- a/src/client_server.rs +++ b/src/client_server.rs @@ -126,7 +126,8 @@ pub fn register_route( let user_id = match UserId::parse_with_server_name( body.username .clone() - .unwrap_or_else(|| utils::random_string(GUEST_NAME_LENGTH)), + .unwrap_or_else(|| utils::random_string(GUEST_NAME_LENGTH)) + .to_lowercase(), db.globals.server_name(), ) .ok()