projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
438394d
)
Fix static FE plug to handle missing Accept header.
author
Phil Hagelberg
<phil@hagelb.org>
Sun, 1 Mar 2020 02:53:49 +0000
(18:53 -0800)
committer
Phil Hagelberg
<phil@hagelb.org>
Sun, 1 Mar 2020 02:53:49 +0000
(18:53 -0800)
lib/pleroma/plugs/static_fe_plug.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/plugs/static_fe_plug.ex
b/lib/pleroma/plugs/static_fe_plug.ex
index b3fb3c582037c1cc7d393edf299dc44a964c1bf3..a8b22c243f7a979a26b82aeb337203afdb9c93f4 100644
(file)
--- 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