1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-10-04 01:08:52 +02:00

fix: use to_lowercase on /register/available username

This commit is contained in:
Timo Kösters 2022-01-31 15:39:46 +01:00
parent e17bbdd42d
commit 23aecb78c7
No known key found for this signature in database
GPG key ID: 356E705610F626D5

View file

@ -60,7 +60,7 @@ pub async fn get_register_available_route(
body: Ruma<get_username_availability::Request<'_>>,
) -> ConduitResult<get_username_availability::Response> {
// Validate user id
let user_id = UserId::parse_with_server_name(body.username.clone(), db.globals.server_name())
let user_id = UserId::parse_with_server_name(body.username.to_lowercase(), db.globals.server_name())
.ok()
.filter(|user_id| {
!user_id.is_historical() && user_id.server_name() == db.globals.server_name()