Skip to content
Snippets Groups Projects
Commit 7b0dd964 authored by lain's avatar lain
Browse files

Slightly nicer webfinger error handling.

parent 571f07ab
No related branches found
No related tags found
No related merge requests found
......@@ -12,10 +12,12 @@ defmodule Pleroma.Web.WebFinger.WebFingerController do
end
def webfinger(conn, %{"resource" => resource}) do
{:ok, response} = WebFinger.webfinger(resource)
conn
|> put_resp_content_type("application/xrd+xml")
|> send_resp(200, response)
with {:ok, response} <- WebFinger.webfinger(resource) do
conn
|> put_resp_content_type("application/xrd+xml")
|> send_resp(200, response)
else
_e -> send_resp(conn, 404, "Couldn't find user")
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment