mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-12 02:35:42 +00:00
17 lines
352 B
Elixir
17 lines
352 B
Elixir
defmodule WandererAppWeb.Plugs.CheckSseDisabled do
|
|
import Plug.Conn
|
|
|
|
def init(opts), do: opts
|
|
|
|
def call(conn, _opts) do
|
|
if not WandererApp.Env.sse_enabled?() do
|
|
conn
|
|
|> put_status(:service_unavailable)
|
|
|> send_resp(503, "Server-Sent Events are disabled on this server")
|
|
|> halt()
|
|
else
|
|
conn
|
|
end
|
|
end
|
|
end
|