1
0
Fork 0
forked from mirrors/akkoma

webfinger: allow resolution of usernames with dots in them (internal actors)

This commit is contained in:
Ariadne Conill 2019-07-17 16:59:29 +00:00
parent a9d6a12bb3
commit 0a6f6e1b5b

View file

@ -32,7 +32,7 @@ def host_meta do
def webfinger(resource, fmt) when fmt in ["XML", "JSON"] do def webfinger(resource, fmt) when fmt in ["XML", "JSON"] do
host = Pleroma.Web.Endpoint.host() host = Pleroma.Web.Endpoint.host()
regex = ~r/(acct:)?(?<username>\w+)@#{host}/ regex = ~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@#{host}/
with %{"username" => username} <- Regex.named_captures(regex, resource), with %{"username" => username} <- Regex.named_captures(regex, resource),
%User{} = user <- User.get_cached_by_nickname(username) do %User{} = user <- User.get_cached_by_nickname(username) do