From: lain Date: Mon, 6 Jul 2020 10:11:10 +0000 (+0200) Subject: StaticFE Plug: Use phoenix helper to get the requested format. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=158c26d7ddb3c77dc99a6298114929faf6a2915a;p=akkoma StaticFE Plug: Use phoenix helper to get the requested format. --- 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