summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-06-08 21:04:16 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-06-08 21:04:30 +0200
commitfe1cb56fdc52092a8af2895fae4c020679156674 (patch)
tree404e091754084b3603b030163ee2942c4b75e217
parentd1924926585a477682b8fcc3176521dacb0766dd (diff)
transmogrifier: MIME.valid?/1 for mediaType
No issues with the rest of the network yet but this makes sure it will work once https://git.pleroma.social/pleroma/pleroma/-/merge_requests/2429 is merged.
-rw-r--r--lib/pleroma/web/activity_pub/transmogrifier.ex6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex
index fda1c71df..543972ae9 100644
--- a/lib/pleroma/web/activity_pub/transmogrifier.ex
+++ b/lib/pleroma/web/activity_pub/transmogrifier.ex
@@ -221,9 +221,9 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
media_type =
cond do
- is_map(url) && is_binary(url["mediaType"]) -> url["mediaType"]
- is_binary(data["mediaType"]) -> data["mediaType"]
- is_binary(data["mimeType"]) -> data["mimeType"]
+ is_map(url) && MIME.valid?(url["mediaType"]) -> url["mediaType"]
+ MIME.valid?(data["mediaType"]) -> data["mediaType"]
+ MIME.valid?(data["mimeType"]) -> data["mimeType"]
true -> nil
end