- conn
- |> put_resp_content_type("application/xrd+xml")
- |> send_resp(200, response)
+ n when n in ["json", "jrd+json"] ->
+ with {:ok, response} <- WebFinger.webfinger(resource, "JSON") do
+ json(conn, response)
+ else
+ _e -> send_resp(conn, 404, "Couldn't find user")
+ end
+
+ _ ->
+ send_resp(conn, 404, "Unsupported format")
+ end
+ end
+
+ def webfinger(conn, _params) do
+ send_resp(conn, 400, "Bad Request")