Merge branch 'feature/1728-webfinger-acct-scheme' into 'develop'

Webfinger: Request account info with the acct scheme

Closes #1728

See merge request pleroma/pleroma!2465
This commit is contained in:
lain 2020-05-06 08:46:45 +00:00
commit f84c8f2f0d
3 changed files with 12 additions and 9 deletions

View file

@ -161,13 +161,15 @@ defmodule Pleroma.Web.WebFinger do
URI.parse(account).host
end
encoded_account = URI.encode("acct:#{account}")
address =
case find_lrdd_template(domain) do
{:ok, template} ->
String.replace(template, "{uri}", URI.encode(account))
String.replace(template, "{uri}", encoded_account)
_ ->
"https://#{domain}/.well-known/webfinger?resource=acct:#{account}"
"https://#{domain}/.well-known/webfinger?resource=#{encoded_account}"
end
with response <-