commit: 916c8c05814ef510b12a34aea08f06e35345de5b
parent e07b3d24426d9aca4fb72182c91467c67c4ee754
Author: Lain Soykaf <lain@lain.com>
Date: Thu, 25 Dec 2025 13:04:09 +0400
ActivityPubController: Don't crash on unknown params
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/pleroma/web/activity_pub/activity_pub_controller.ex b/lib/pleroma/web/activity_pub/activity_pub_controller.ex
@@ -31,6 +31,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
@federating_only_actions [:internal_fetch, :relay, :relay_following, :relay_followers]
+ @object_replies_known_param_keys ["page", "min_id", "max_id", "since_id", "limit"]
+
plug(FederatingPlug when action in @federating_only_actions)
plug(
@@ -104,7 +106,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
# also convert our params to atoms here.
params =
params
- |> Map.new(fn {k, v} -> {String.to_existing_atom(k), v} end)
+ |> Map.take(@object_replies_known_param_keys)
+ |> Enum.into(%{}, fn {k, v} -> {String.to_existing_atom(k), v} end)
|> Map.put(:object_ap_id, object_ap_id)
|> Map.put(:order_asc, true)
|> Map.put(:conn, conn)