diff --git a/lib/mobilizon_web/controllers/activity_pub_controller.ex b/lib/mobilizon_web/controllers/activity_pub_controller.ex index 68ad7706..7d377df6 100644 --- a/lib/mobilizon_web/controllers/activity_pub_controller.ex +++ b/lib/mobilizon_web/controllers/activity_pub_controller.ex @@ -13,9 +13,10 @@ defmodule MobilizonWeb.ActivityPubController do with %Actor{} = actor <- Actors.get_local_actor_by_name(name) do case get_req_header(conn, "accept") do ["application/activity+json"] -> - conn - |> put_resp_header("content-type", "application/activity+json") - |> json(ActorView.render("actor.json", %{actor: actor})) + conn |> render_ap_actor(actor) + + ["application/activity+json, application/ld+json"] -> + conn |> render_ap_actor(actor) _ -> conn @@ -27,6 +28,12 @@ defmodule MobilizonWeb.ActivityPubController do end end + defp render_ap_actor(conn, %Actor{} = actor) do + conn + |> put_resp_header("content-type", "application/activity+json") + |> json(ActorView.render("actor.json", %{actor: actor})) + end + def event(conn, %{"uuid" => uuid}) do with %Event{} = event <- Events.get_event_full_by_uuid(uuid), true <- event.public do