defmodule FinalTrackWeb.Plugs.RequireFederation do
@moduledoc "404 for every ActivityPub route while federation is off (the default)."
import Plug.Conn
def init(opts), do: opts
def call(conn, _opts) do
if FinalTrack.Federation.enabled?(),
do: conn,
else: conn |> send_resp(404, "Not Found") |> halt()
end
end
neiam
/final_track
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
337 B · text
History
cff00cb