Pleroma/lib/pleroma/plugs/federating_plug.ex

19 lines
366 B
Elixir
Raw Normal View History

2018-11-05 15:19:03 +01:00
defmodule Pleroma.Web.FederatingPlug do
import Plug.Conn
def init(options) do
options
end
2018-12-09 10:12:48 +01:00
def call(conn, _opts) do
2018-11-05 15:19:03 +01:00
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