fix(api): 🐛 Fix lookup endpoints thinking local user is remote

This commit is contained in:
Jesse Wierzbinski 2024-11-23 23:09:59 +01:00
parent ace6921447
commit da369e604c
No known key found for this signature in database
2 changed files with 12 additions and 2 deletions

View file

@ -106,6 +106,16 @@ export const userAddressValidator = createRegExp(
[global],
);
export const userAddressValidatorRemote = createRegExp(
maybe("@"),
oneOrMore(anyOf(letter.lowercase, digit, charIn("-_"))).groupedAs(
"username",
),
exactly("@"),
oneOrMore(anyOf(letter, digit, charIn("_-.:"))).groupedAs("domain"),
[global],
);
export const webfingerMention = createRegExp(
exactly("acct:"),
oneOrMore(anyOf(letter, digit, charIn("-_"))).groupedAs("username"),