logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 6a22a80f9f86dade9976e0f3363b4415edd933d0
parent e53c20b03c934c725726f49b2ca98b0bd9406bef
Author: Mark Felder <feld@feld.me>
Date:   Sun, 28 Jan 2024 17:39:46 -0500

Pleroma.Web.MastodonAPI.DirectoryController: dialyzer errors

lib/pleroma/web/mastodon_api/controllers/directory_controller.ex:6:unused_fun
Function skip_auth/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/directory_controller.ex:6:unused_fun
Function skip_plug/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/mastodon_api/controllers/directory_controller.ex:18:guard_fail
The guard clause:

when _action :: atom() == <<105, 110, 100, 101, 120>>

can never succeed.

Diffstat:

Achangelog.d/mastodon_directory.fix1+
Mlib/pleroma/web/mastodon_api/controllers/directory_controller.ex2+-
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/changelog.d/mastodon_directory.fix b/changelog.d/mastodon_directory.fix @@ -0,0 +1 @@ +Mastodon API /api/v1/directory: Fix listing directory contents when not authenticated diff --git a/lib/pleroma/web/mastodon_api/controllers/directory_controller.ex b/lib/pleroma/web/mastodon_api/controllers/directory_controller.ex @@ -15,7 +15,7 @@ defmodule Pleroma.Web.MastodonAPI.DirectoryController do plug(Pleroma.Web.ApiSpec.CastAndValidate) - plug(:skip_auth when action == "index") + plug(:skip_auth when action == :index) defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.DirectoryOperation