This commit is contained in:
Phantasm 2026-03-05 11:48:37 +01:00 committed by Phantasm
commit 3760480813
2 changed files with 6 additions and 5 deletions

View file

@ -30,6 +30,7 @@ defmodule Pleroma.Web.Plugs.FaviconPlug do
# Favicon should always be available and this should never occur. # Favicon should always be available and this should never occur.
# If it does, halt the pipeline before having unintended side-effects. # If it does, halt the pipeline before having unintended side-effects.
Logger.error("No favicon.png found! Is the default favicon deleted?") Logger.error("No favicon.png found! Is the default favicon deleted?")
conn conn
|> send_resp(404, "Not found") |> send_resp(404, "Not found")
|> halt() |> halt()
@ -40,7 +41,7 @@ defmodule Pleroma.Web.Plugs.FaviconPlug do
conn conn
end end
defp find_favicon_dir() do defp find_favicon_dir do
instance_dir = Pleroma.Config.get([:instance, :static_dir], "instance/static") instance_dir = Pleroma.Config.get([:instance, :static_dir], "instance/static")
instance_path = Path.join(instance_dir, "favicon.png") instance_path = Path.join(instance_dir, "favicon.png")

View file

@ -48,7 +48,7 @@ defmodule Pleroma.Web.Plugs.FaviconPlugTest do
body_size = byte_size(conn.resp_body) body_size = byte_size(conn.resp_body)
assert conn.status == 200 assert conn.status == 200
assert body_size == 104426 assert body_size == 104_426
assert response_content_type(conn, :png) assert response_content_type(conn, :png)
end end