summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-08-07 14:38:29 -0400
committerMark Felder <feld@feld.me>2024-08-07 14:38:29 -0400
commit8f15000c0f4c81b27b3a7077092f1ba1b37da205 (patch)
tree24248c92fbea098aa22878584d77b3b5d2133fe8
parentd2d07bfe4b9f1567c205a736e6e81e02d13598c1 (diff)
downloadpleroma-8f15000c0f4c81b27b3a7077092f1ba1b37da205.tar.gz
pleroma-8f15000c0f4c81b27b3a7077092f1ba1b37da205.zip
Do not require a cc field when validating an incoming Follow activity
The cc field is not required and the code was keeping the cc if it existed on an activity or replacing it with the default of an empty list when casting. If any Follow activity was received with a cc field, it would attempt to keep it. This was noticed in !4208 where we would craft Follow requests with a cc value of nil.
-rw-r--r--lib/pleroma/web/activity_pub/object_validators/follow_validator.ex2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/object_validators/follow_validator.ex b/lib/pleroma/web/activity_pub/object_validators/follow_validator.ex
index b3ca5b691..e4e97bf72 100644
--- a/lib/pleroma/web/activity_pub/object_validators/follow_validator.ex
+++ b/lib/pleroma/web/activity_pub/object_validators/follow_validator.ex
@@ -29,7 +29,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.FollowValidator do
defp validate_data(cng) do
cng
- |> validate_required([:id, :type, :actor, :to, :cc, :object])
+ |> validate_required([:id, :type, :actor, :to, :object])
|> validate_inclusion(:type, ["Follow"])
|> validate_inclusion(:state, ~w{pending reject accept})
|> validate_actor_presence()