forked from lavina/lavina
1
0
Fork 0

xmpp: relax the jid regex a bit

This commit is contained in:
Nikita Vilunov 2024-04-18 01:42:28 +02:00
parent fbb3d4f4f9
commit 02a8309d9e
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ impl Jid {
use lazy_static::lazy_static;
use regex::Regex;
lazy_static! {
static ref RE: Regex = Regex::new(r"^(([a-zA-Z]+)@)?([a-zA-Z.]+)(/([a-zA-Z\-]+))?$").unwrap();
static ref RE: Regex = Regex::new(r"^(([a-zA-Z0-9]+)@)?([^@/]+)(/([a-zA-Z0-9\-]+))?$").unwrap();
}
let m = RE.captures(i).ok_or(anyhow!("Incorrectly format jid: {i}"))?;