StaticFE Plug: Use phoenix helper to get the requested format.
This commit is contained in:
parent
ed4f9f6a29
commit
158c26d7dd
@ -21,12 +21,6 @@ def call(conn, _) 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 New Issue
Block a user