1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-09-11 14:17:21 +01:00

AttachmentValidator: Check if the mime type is valid.

This commit is contained in:
lain 2020-06-07 09:19:00 +02:00
parent 40fc4e974e
commit 0365053c8d

View file

@ -45,11 +45,11 @@ def fix_media_type(data) 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