Follow webfinger redirects.
This commit is contained in:
parent
96014f8e0b
commit
b104348fa5
|
@ -92,7 +92,7 @@ def finger(account, getter \\ &HTTPoison.get/3) do
|
||||||
response = with {:ok, result} <- getter.("https:" <> address, ["Accept": "application/xrd+xml"], [params: [resource: account]]) do
|
response = with {:ok, result} <- getter.("https:" <> address, ["Accept": "application/xrd+xml"], [params: [resource: account]]) do
|
||||||
{:ok, result}
|
{:ok, result}
|
||||||
else _ ->
|
else _ ->
|
||||||
getter.("http:" <> address, ["Accept": "application/xrd+xml"], [params: [resource: account]])
|
getter.("http:" <> address, ["Accept": "application/xrd+xml"], [params: [resource: account], follow_redirect: true])
|
||||||
end
|
end
|
||||||
|
|
||||||
with {:ok, %{status_code: status_code, body: body}} when status_code in 200..299 <- response,
|
with {:ok, %{status_code: status_code, body: body}} when status_code in 200..299 <- response,
|
||||||
|
|
Loading…
Reference in New Issue