MIME.valid?(type) → is_bitstring(type) && MIME.extensions(type) != []
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Mon, 31 May 2021 08:41:31 +0000 (10:41 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Thu, 3 Jun 2021 17:11:17 +0000 (19:11 +0200)
commit11844084d0fce0bd94df66561c47ef21b7b38e1d
tree6f69a92db2616c2cc69e0253fd5a71ff81bdba4c
parent24d66b60a0272ef4e78f2f9802682964059c44ce
MIME.valid?(type) → is_bitstring(type) && MIME.extensions(type) != []

Since mime 1.6.0:

  warning: MIME.valid?/1 is deprecated. Use MIME.extensions(type) != [] instead

As for the bitstring(type) part it's because MIME.extensions only expects a string.
https://github.com/elixir-plug/mime/issues/43
lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
lib/pleroma/web/activity_pub/transmogrifier.ex