StaticFE Plug: Use phoenix helper to get the requested format.

This commit is contained in:
lain 2020-07-06 12:11:10 +02:00
parent ed4f9f6a29
commit 158c26d7dd
1 changed files with 1 additions and 7 deletions

View File

@ -21,12 +21,6 @@ def call(conn, _) do
defp enabled?, do: Pleroma.Config.get([:static_fe, :enabled], false)
defp requires_html?(conn) do
case get_req_header(conn, "accept") do
[accept | _] ->
!String.contains?(accept, "json") && String.contains?(accept, "text/html")
_ ->
false
end
Phoenix.Controller.get_format(conn) == "html"
end
end