Favicon Plug: Update moduledoc and rename to adhere to convention

This commit is contained in:
Phantasm 2026-03-05 11:43:55 +01:00 committed by Phantasm
commit 662c9f36ac
2 changed files with 5 additions and 4 deletions

View file

@ -65,7 +65,7 @@ defmodule Pleroma.Web.Endpoint do
} }
) )
plug(Pleroma.Web.Plugs.Favicon, plug(Pleroma.Web.Plugs.FaviconPlug,
at: "/", at: "/",
only: ["favicon.png"], only: ["favicon.png"],
cache_control_for_etags: @favicon_cache_control, cache_control_for_etags: @favicon_cache_control,

View file

@ -2,12 +2,13 @@
# Copyright © 2017-2026 Pleroma Authors <https://pleroma.social/> # Copyright © 2017-2026 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only # SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.Favicon do defmodule Pleroma.Web.Plugs.FaviconPlug do
@behaviour Plug @behaviour Plug
@moduledoc """ @moduledoc """
Serves favicon.png directly from the instance static directory, This is a shim to call `Plug.Static` but with runtime `from` configuration for instance favicon.
bypassing the frontend-specific logic.
Serves default or custom favicon.png with cacheable cache-control.
""" """
import Plug.Conn, only: [put_resp_header: 3] import Plug.Conn, only: [put_resp_header: 3]