Don't check for availability of usernames that aren't ASCII (#4469)

This commit is contained in:
Quentin Gliech
2025-04-28 17:36:38 +02:00
committed by GitHub

View File

@@ -209,6 +209,12 @@ impl HomeserverConnection for SynapseConnection {
err(Debug),
)]
async fn is_localpart_available(&self, localpart: &str) -> Result<bool, anyhow::Error> {
// Synapse will give us a M_UNKNOWN error if the localpart is not ASCII,
// so we bail out early
if !localpart.is_ascii() {
return Ok(false);
}
let localpart = urlencoding::encode(localpart);
let response = self