diff options
author | rinpatch <rinpatch@sdf.org> | 2020-03-15 21:54:24 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-03-15 21:54:24 +0000 |
commit | bb49d8f5a0dbbad65a8f65a28cc2d0847b518067 (patch) | |
tree | 938fb7fd74053a816c21948b28d5f6cfb7443f37 /lib/pleroma/plugs/static_fe_plug.ex | |
parent | e8493431bfc16977e43715bf8bdb09ac46580028 (diff) | |
parent | 8d15d6c3ab9aecb82ba5126bb5efef20b3dfef41 (diff) | |
download | pleroma-2.0.1.tar.gz |
Merge branch 'release/2.0.1' into 'stable'v2.0.1
2.0.1 release
See merge request pleroma/pleroma!2298
Diffstat (limited to 'lib/pleroma/plugs/static_fe_plug.ex')
-rw-r--r-- | lib/pleroma/plugs/static_fe_plug.ex | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/plugs/static_fe_plug.ex b/lib/pleroma/plugs/static_fe_plug.ex index deebe4879..156e6788e 100644 --- a/lib/pleroma/plugs/static_fe_plug.ex +++ b/lib/pleroma/plugs/static_fe_plug.ex @@ -21,6 +21,9 @@ defmodule Pleroma.Plugs.StaticFEPlug do defp enabled?, do: Pleroma.Config.get([:static_fe, :enabled], false) defp accepts_html?(conn) do - conn |> get_req_header("accept") |> List.first() |> String.contains?("text/html") + case get_req_header(conn, "accept") do + [accept | _] -> String.contains?(accept, "text/html") + _ -> false + end end end |