StaticFE Plug: Use phoenix helper to get the requested format.
This commit is contained in:
parent
ed4f9f6a29
commit
158c26d7dd
1 changed files with 1 additions and 7 deletions
|
@ -21,12 +21,6 @@ defmodule Pleroma.Plugs.StaticFEPlug do
|
||||||
defp enabled?, do: Pleroma.Config.get([:static_fe, :enabled], false)
|
defp enabled?, do: Pleroma.Config.get([:static_fe, :enabled], false)
|
||||||
|
|
||||||
defp requires_html?(conn) do
|
defp requires_html?(conn) do
|
||||||
case get_req_header(conn, "accept") do
|
Phoenix.Controller.get_format(conn) == "html"
|
||||||
[accept | _] ->
|
|
||||||
!String.contains?(accept, "json") && String.contains?(accept, "text/html")
|
|
||||||
|
|
||||||
_ ->
|
|
||||||
false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue