mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 16:24:23 +00:00
20 lines
403 B
Elixir
20 lines
403 B
Elixir
defmodule Pleroma.Web.FederatingPlug do
|
|
import Plug.Conn
|
|
|
|
def init(options) do
|
|
options
|
|
end
|
|
|
|
def call(conn, _opts) do
|
|
if Keyword.get(Application.get_env(:pleroma, :instance), :federating) do
|
|
conn
|
|
else
|
|
conn
|
|
|> put_status(404)
|
|
|> Phoenix.Controller.put_view(Pleroma.Web.ErrorView)
|
|
|> Phoenix.Controller.render("404.json")
|
|
|> halt()
|
|
end
|
|
end
|
|
end
|