diff options
author | Lain Soykaf <lain@lain.com> | 2022-12-15 17:46:20 -0500 |
---|---|---|
committer | Lain Soykaf <lain@lain.com> | 2022-12-15 17:46:20 -0500 |
commit | 9838790a7d14e72449af3ae53daf3df30fd1aba0 (patch) | |
tree | 80d90f2254aaf1910f3ffb7ff1358e2066f77357 /lib | |
parent | 63d00f8123ddc5a8d9917e48216775f98ceac713 (diff) | |
download | pleroma-9838790a7d14e72449af3ae53daf3df30fd1aba0.tar.gz pleroma-9838790a7d14e72449af3ae53daf3df30fd1aba0.zip |
AttachmentValidator: Actually require url
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex b/lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex index 14f51e2c5..398020bff 100644 --- a/lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex +++ b/lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex @@ -45,9 +45,9 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator do struct |> cast(data, [:id, :type, :mediaType, :name, :blurhash]) - |> cast_embed(:url, with: &url_changeset/2) + |> cast_embed(:url, with: &url_changeset/2, required: true) |> validate_inclusion(:type, ~w[Link Document Audio Image Video]) - |> validate_required([:type, :mediaType, :url]) + |> validate_required([:type, :mediaType]) end def url_changeset(struct, data) do @@ -91,6 +91,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator do defp validate_data(cng) do cng |> validate_inclusion(:type, ~w[Document Audio Image Video]) - |> validate_required([:mediaType, :url, :type]) + |> validate_required([:mediaType, :type]) end end |