projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f9fbd7
)
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
rinpatch
<rinpatch@sdf.org>
Sun, 15 Mar 2020 14:00:06 +0000
(17:00 +0300)
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 deebe48791ceb8cc9185a3c5d9cba020a1f6c2d0..156e6788e0980fbf658ccf9fcd72a975d65ab2c6 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