mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Slightly nicer webfinger error handling.
This commit is contained in:
parent
571f07abe3
commit
7b0dd964be
1 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue