From 916c8c05814ef510b12a34aea08f06e35345de5b Mon Sep 17 00:00:00 2001 From: Lain Soykaf Date: Thu, 25 Dec 2025 13:04:09 +0400 Subject: [PATCH] ActivityPubController: Don't crash on unknown params --- lib/pleroma/web/activity_pub/activity_pub_controller.ex | 5 ++++- 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 index fd4533604..89030b3df 100644 --- 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)