Commit b104348f authored by lain's avatar lain
Browse files

Follow webfinger redirects.

parent 96014f8e
......@@ -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
{:ok, result}
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
with {:ok, %{status_code: status_code, body: body}} when status_code in 200..299 <- response,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment