Runtime configured router

This commit is contained in:
href 2018-11-05 15:19:03 +01:00
commit 6fe23c5458
No known key found for this signature in database
GPG key ID: EE8296C1A152C325
8 changed files with 67 additions and 35 deletions

View file

@ -0,0 +1,18 @@
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