diff options
author | lain <lain@soykaf.club> | 2020-07-06 12:11:10 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-07-06 12:11:10 +0200 |
commit | 158c26d7ddb3c77dc99a6298114929faf6a2915a (patch) | |
tree | 86a5cc0ad9afb6158d18ef6c4200a7c6e147b1da | |
parent | ed4f9f6a29d8cf2dd31e41bae7e63aaa15bc9548 (diff) | |
download | pleroma-158c26d7ddb3c77dc99a6298114929faf6a2915a.tar.gz |
StaticFE Plug: Use phoenix helper to get the requested format.
-rw-r--r-- | lib/pleroma/plugs/static_fe_plug.ex | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/pleroma/plugs/static_fe_plug.ex b/lib/pleroma/plugs/static_fe_plug.ex index 7c69b2dac..143665c71 100644 --- a/lib/pleroma/plugs/static_fe_plug.ex +++ b/lib/pleroma/plugs/static_fe_plug.ex @@ -21,12 +21,6 @@ defmodule Pleroma.Plugs.StaticFEPlug 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 |