cleanup
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
parent
8827e51170
commit
fd177a363b
2 changed files with 5 additions and 7 deletions
|
|
@ -3330,10 +3330,10 @@ config :pleroma, :config_description, [
|
||||||
children: frontend_options
|
children: frontend_options
|
||||||
},
|
},
|
||||||
%{
|
%{
|
||||||
key: :pickable,
|
key: :pickable,
|
||||||
type: {:list, :string},
|
type: {:list, :string},
|
||||||
description:
|
description:
|
||||||
"A list containing all frontends users can pick as their preference, format is :name/:ref, e.g pleroma-fe/stable."
|
"A list containing all frontends users can pick as their preference, format is :name/:ref, e.g pleroma-fe/stable."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@ defmodule Pleroma.Web.Plugs.FrontendStatic do
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(conn, opts) do
|
def call(conn, opts) do
|
||||||
IO.inspect("OPTS: #{inspect(opts)}")
|
|
||||||
with false <- api_route?(conn.path_info),
|
with false <- api_route?(conn.path_info),
|
||||||
false <- invalid_path?(conn.path_info),
|
false <- invalid_path?(conn.path_info),
|
||||||
fallback_frontend_type <- Map.get(opts, :frontend_type, :primary),
|
fallback_frontend_type <- Map.get(opts, :frontend_type, :primary),
|
||||||
|
|
@ -81,7 +80,7 @@ defmodule Pleroma.Web.Plugs.FrontendStatic do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def preferred_or_fallback(conn, fallback), do: fallback
|
def preferred_or_fallback(_conn, fallback), do: fallback
|
||||||
|
|
||||||
defp invalid_path?(list) do
|
defp invalid_path?(list) do
|
||||||
invalid_path?(list, :binary.compile_pattern(["/", "\\", ":", "\0"]))
|
invalid_path?(list, :binary.compile_pattern(["/", "\\", ":", "\0"]))
|
||||||
|
|
@ -100,7 +99,6 @@ defmodule Pleroma.Web.Plugs.FrontendStatic do
|
||||||
|
|
||||||
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)
|
||||||
IO.inspect(opts, label: "opts")
|
|
||||||
Plug.Static.call(conn, opts)
|
Plug.Static.call(conn, opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue