forked from AkkomaGang/akkoma
Webfinger: Request account info with the acct scheme
This commit is contained in:
parent
095635453a
commit
a7966f2080
2 changed files with 11 additions and 9 deletions
|
@ -194,13 +194,15 @@ def finger(account) do
|
||||||
URI.parse(account).host
|
URI.parse(account).host
|
||||||
end
|
end
|
||||||
|
|
||||||
|
encoded_account = URI.encode("acct:#{account}")
|
||||||
|
|
||||||
address =
|
address =
|
||||||
case find_lrdd_template(domain) do
|
case find_lrdd_template(domain) do
|
||||||
{:ok, template} ->
|
{: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
|
end
|
||||||
|
|
||||||
with response <-
|
with response <-
|
||||||
|
|
|
@ -211,7 +211,7 @@ def get(
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(
|
def get(
|
||||||
"https://squeet.me/xrd/?uri=lain@squeet.me",
|
"https://squeet.me/xrd/?uri=acct:lain@squeet.me",
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
||||||
|
@ -870,7 +870,7 @@ def get(
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(
|
def get(
|
||||||
"https://social.heldscal.la/.well-known/webfinger?resource=shp@social.heldscal.la",
|
"https://social.heldscal.la/.well-known/webfinger?resource=acct:shp@social.heldscal.la",
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
||||||
|
@ -883,7 +883,7 @@ def get(
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(
|
def get(
|
||||||
"https://social.heldscal.la/.well-known/webfinger?resource=invalid_content@social.heldscal.la",
|
"https://social.heldscal.la/.well-known/webfinger?resource=acct:invalid_content@social.heldscal.la",
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
||||||
|
@ -900,7 +900,7 @@ def get("http://framatube.org/.well-known/host-meta", _, _, _) do
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(
|
def get(
|
||||||
"http://framatube.org/main/xrd?uri=framasoft@framatube.org",
|
"http://framatube.org/main/xrd?uri=acct:framasoft@framatube.org",
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
||||||
|
@ -959,7 +959,7 @@ def get("http://gerzilla.de/.well-known/host-meta", _, _, _) do
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(
|
def get(
|
||||||
"https://gerzilla.de/xrd/?uri=kaniini@gerzilla.de",
|
"https://gerzilla.de/xrd/?uri=acct:kaniini@gerzilla.de",
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
||||||
|
@ -1155,7 +1155,7 @@ def get("http://404.site" <> _, _, _, _) do
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(
|
def get(
|
||||||
"https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=lain@zetsubou.xn--q9jyb4c",
|
"https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=acct:lain@zetsubou.xn--q9jyb4c",
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
||||||
|
@ -1168,7 +1168,7 @@ def get(
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(
|
def get(
|
||||||
"https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=https://zetsubou.xn--q9jyb4c/users/lain",
|
"https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=acct:https://zetsubou.xn--q9jyb4c/users/lain",
|
||||||
_,
|
_,
|
||||||
_,
|
_,
|
||||||
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
[{"accept", "application/xrd+xml,application/jrd+json"}]
|
||||||
|
|
Loading…
Reference in a new issue