mirror of
https://github.com/jtomchak/akkoma.git
synced 2025-01-19 06:06:05 +01:00
18 lines
366 B
Elixir
18 lines
366 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.render(Pleroma.Web.ErrorView, "404.json")
|
|
|> halt()
|
|
end
|
|
end
|
|
end
|