2024-09-26 01:45:10 +00:00
|
|
|
defmodule PostlandWeb.OutboxController do
|
2024-09-30 00:53:00 +00:00
|
|
|
use PostlandWeb, :controller
|
2024-09-26 01:45:10 +00:00
|
|
|
|
2024-09-30 00:53:00 +00:00
|
|
|
require Logger
|
|
|
|
|
|
|
|
|
|
alias ActivityPub.Headers
|
2024-09-26 01:45:10 +00:00
|
|
|
|
|
|
|
|
def get(conn, _params) do
|
|
|
|
|
json = %{
|
|
|
|
|
"@context" => "https://www.w3.org/ns/activitystreams",
|
|
|
|
|
"summary" => "",
|
|
|
|
|
"type" => "OrderedCollection",
|
|
|
|
|
"totalItems" => 0,
|
|
|
|
|
"orderedItems" => []
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-01 22:43:40 +00:00
|
|
|
if Headers.verify(conn.method, conn.request_path, conn.req_headers, conn.assigns.raw_body) do
|
2024-10-11 02:48:53 +00:00
|
|
|
Plug.Conn.send_resp(conn, 200, Jason.encode!(json))
|
2024-09-26 01:45:10 +00:00
|
|
|
else
|
2024-09-30 00:53:00 +00:00
|
|
|
send_resp(conn, 403, "forbidden")
|
2024-09-26 01:45:10 +00:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|