Skip to content

Commit ecade0a

Browse files
committed
Don't check for availability of usernames that aren't ASCII
1 parent e243b62 commit ecade0a

File tree

1 file changed

+6
-0
lines changed
  • crates/matrix-synapse/src

1 file changed

+6
-0
lines changed

crates/matrix-synapse/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ impl HomeserverConnection for SynapseConnection {
209209
err(Debug),
210210
)]
211211
async fn is_localpart_available(&self, localpart: &str) -> Result<bool, anyhow::Error> {
212+
// Synapse will give us a M_UNKNOWN error if the localpart is not ASCII,
213+
// so we bail out early
214+
if !localpart.is_ascii() {
215+
return Ok(false);
216+
}
217+
212218
let localpart = urlencoding::encode(localpart);
213219

214220
let response = self

0 commit comments

Comments
 (0)