Enforce an exact domain match for WebFinger resolution
The regex was not being terminated with an $
This commit is contained in:
parent
736686b4e2
commit
17987e3990
3 changed files with 20 additions and 2 deletions
|
|
@ -35,9 +35,9 @@ defmodule Pleroma.Web.WebFinger do
|
|||
|
||||
regex =
|
||||
if webfinger_domain = Pleroma.Config.get([__MODULE__, :domain]) do
|
||||
~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@(#{host}|#{webfinger_domain})/
|
||||
~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@(#{host}|#{webfinger_domain})$/
|
||||
else
|
||||
~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@#{host}/
|
||||
~r/(acct:)?(?<username>[a-z0-9A-Z_\.-]+)@#{host}$/
|
||||
end
|
||||
|
||||
with %{"username" => username} <- Regex.named_captures(regex, resource),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue