mirror of
https://github.com/LemmyNet/activitypub-federation-rust.git
synced 2024-06-10 17:29:34 +00:00
Change username regex in webfinger
Changes the regex used for username in `extract_webfinger_name` to include additional characters like '.' and '-'. This is the same regex used in Mastodon.
This commit is contained in:
parent
c56f526914
commit
1db2d49522
|
@ -71,8 +71,11 @@ where
|
|||
T: Clone,
|
||||
{
|
||||
// TODO: would be nice if we could implement this without regex and remove the dependency
|
||||
let regex = Regex::new(&format!("^acct:([a-zA-Z0-9_]{{3,}})@{}$", data.domain()))
|
||||
.map_err(Error::other)?;
|
||||
let regex = Regex::new(&format!(
|
||||
"^acct:((?i)[a-z0-9_]+([a-z0-9_\\.-]+[a-z0-9_]+)?)@{}$",
|
||||
data.domain()
|
||||
))
|
||||
.map_err(Error::other)?;
|
||||
Ok(regex
|
||||
.captures(query)
|
||||
.and_then(|c| c.get(1))
|
||||
|
|
Loading…
Reference in a new issue