Change to not require `magic-public-key` on WebFinger

This commit is contained in:
kPherox 2019-07-24 23:38:38 +09:00
parent e818381042
commit ac27b94ffa
No known key found for this signature in database
GPG Key ID: C04751C2BFA2F62D
1 changed files with 10 additions and 4 deletions

View File

@ -86,11 +86,17 @@ defmodule Pleroma.Web.WebFinger do
|> XmlBuilder.to_doc()
end
defp get_magic_key(magic_key) do
"data:application/magic-public-key," <> magic_key = magic_key
defp get_magic_key("data:application/magic-public-key," <> magic_key) do
{:ok, magic_key}
rescue
MatchError -> {:error, "Missing magic key data."}
end
defp get_magic_key(nil) do
Logger.debug("Undefined magic key.")
{:ok, nil}
end
defp get_magic_key(_) do
{:error, "Missing magic key data."}
end
defp webfinger_from_xml(doc) do