mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 11:19:19 +00:00
Improved recursion through the api route list
This commit is contained in:
parent
6b87dfad5d
commit
1552179792
1 changed files with 3 additions and 5 deletions
|
@ -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?([h | t], match), do: String.contains?(h, match) or invalid_path?(t)
|
||||||
defp invalid_path?([], _match), do: false
|
defp invalid_path?([], _match), do: false
|
||||||
|
|
||||||
defp api_route?(list) when is_list(list) and length(list) > 0 do
|
defp api_route?([h | _]) when h in @api_routes, do: true
|
||||||
List.first(list) in @api_routes
|
defp api_route?([_ | t]), do: api_route?(t)
|
||||||
end
|
defp api_route?([]), do: false
|
||||||
|
|
||||||
defp api_route?(_), do: false
|
|
||||||
|
|
||||||
defp call_static(conn, opts, from) do
|
defp call_static(conn, opts, from) do
|
||||||
opts = Map.put(opts, :from, from)
|
opts = Map.put(opts, :from, from)
|
||||||
|
|
Loading…
Reference in a new issue