projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6b87dfa
)
Improved recursion through the api route list
author
Mark Felder
<feld@feld.me>
Thu, 25 Feb 2021 16:07:29 +0000
(10:07 -0600)
committer
Mark Felder
<feld@feld.me>
Thu, 25 Feb 2021 16:07:29 +0000
(10:07 -0600)
lib/pleroma/web/plugs/frontend_static.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/plugs/frontend_static.ex
b/lib/pleroma/web/plugs/frontend_static.ex
index 03fd510431e882ab2c17bcb3cd01560d6dd687b1..eb385e94dfc97020acd05ba0b3d988fa9e1007a9 100644
(file)
--- a/
lib/pleroma/web/plugs/frontend_static.ex
+++ b/
lib/pleroma/web/plugs/frontend_static.ex
@@
-55,11
+55,9
@@
defmodule Pleroma.Web.Plugs.FrontendStatic do
defp invalid_path?([h | t], match), do: String.contains?(h, match) or invalid_path?(t)
defp invalid_path?([], _match), do: false
defp invalid_path?([h | t], match), do: String.contains?(h, match) or invalid_path?(t)
defp invalid_path?([], _match), do: false
- defp api_route?(list) when is_list(list) and length(list) > 0 do
- List.first(list) in @api_routes
- end
-
- defp api_route?(_), do: false
+ defp api_route?([h | _]) when h in @api_routes, do: true
+ defp api_route?([_ | t]), do: api_route?(t)
+ defp api_route?([]), do: false
defp call_static(conn, opts, from) do
opts = Map.put(opts, :from, from)
defp call_static(conn, opts, from) do
opts = Map.put(opts, :from, from)