Commit 658f30c0 authored by rinpatch's avatar rinpatch

Merge branch 'static-accept-missing' into 'develop'

Fix static FE plug to handle missing Accept header.

See merge request pleroma/pleroma!2260
parents 3e0f05f0 523f73dc
......@@ -21,6 +21,9 @@ def call(conn, _) 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment