Apply lambadalambda's suggestion(s) to 1 file(s)
This commit is contained in:
parent
43a124bb14
commit
374e8c85a7
1 changed files with 2 additions and 9 deletions
|
|
@ -42,15 +42,8 @@ defmodule Pleroma.Web.WebFinger.WebFingerController do
|
|||
end
|
||||
|
||||
# Default to JSON when no format is specified or format is not recognized
|
||||
def webfinger(%{assigns: %{format: _format}} = conn, %{"resource" => resource}) do
|
||||
with {:ok, response} <- WebFinger.webfinger(resource, "JSON") do
|
||||
json(conn, response)
|
||||
else
|
||||
_e ->
|
||||
conn
|
||||
|> put_status(404)
|
||||
|> json("Couldn't find user")
|
||||
end
|
||||
def webfinger(%{assigns: %{format: _format}} = conn, %{"resource" => _resource} = params) do
|
||||
webfinger(put_in(conn.assigns.format, "json"), params)
|
||||
end
|
||||
|
||||
def webfinger(conn, _params), do: send_resp(conn, 400, "Bad Request")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue