webfinger: allow resolution of usernames with dots in them (internal actors)
authorAriadne Conill <ariadne@dereferenced.org>
Wed, 17 Jul 2019 16:59:29 +0000 (16:59 +0000)
committerAriadne Conill <ariadne@dereferenced.org>
Wed, 17 Jul 2019 16:59:29 +0000 (16:59 +0000)
lib/pleroma/web/web_finger/web_finger.ex

index 3fca72de84f9806eddf5547638a2503a46390fc1..fa34c7ced9e7bff22c735606510ba3a10bfded56 100644 (file)
@@ -32,7 +32,7 @@ defmodule Pleroma.Web.WebFinger do
 
   def webfinger(resource, fmt) when fmt in ["XML", "JSON"] do
     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),
          %User{} = user <- User.get_cached_by_nickname(username) do