From 158c26d7ddb3c77dc99a6298114929faf6a2915a Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 6 Jul 2020 12:11:10 +0200 Subject: [PATCH] StaticFE Plug: Use phoenix helper to get the requested format. --- lib/pleroma/plugs/static_fe_plug.ex | 8 +------- 1 file changed, 1 insertion(+), 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 -- 2.45.2