AttachmentValidator: Check if the mime type is valid.
This commit is contained in:
parent
40fc4e974e
commit
0365053c8d
|
@ -45,11 +45,11 @@ def fix_media_type(data) do
|
||||||
data
|
data
|
||||||
|> Map.put_new("mediaType", data["mimeType"])
|
|> Map.put_new("mediaType", data["mimeType"])
|
||||||
|
|
||||||
if data["mediaType"] == "" do
|
if MIME.valid?(data["mediaType"]) do
|
||||||
data
|
data
|
||||||
|> Map.put("mediaType", "application/octet-stream")
|
|
||||||
else
|
else
|
||||||
data
|
data
|
||||||
|
|> Map.put("mediaType", "application/octet-stream")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue