projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40fc4e9
)
AttachmentValidator: Check if the mime type is valid.
author
lain
<lain@soykaf.club>
Sun, 7 Jun 2020 07:19:00 +0000
(09:19 +0200)
committer
lain
<lain@soykaf.club>
Sun, 7 Jun 2020 07:19:00 +0000
(09:19 +0200)
lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
patch
|
blob
|
history
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 c4b502cb971ac75ce0a45aa517e7a8da1904e4f8..f53bb02bec8d3261ec76e00cf1948b4907fb5c9e 100644
(file)
--- a/
lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
+++ b/
lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
@@
-45,11
+45,11
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator do
data
|> Map.put_new("mediaType", data["mimeType"])
- if
data["mediaType"] == ""
do
+ if
MIME.valid?(data["mediaType"])
do
data
- |> Map.put("mediaType", "application/octet-stream")
else
data
+ |> Map.put("mediaType", "application/octet-stream")
end
end