mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-20 04:04:44 +00:00
Merge branch 'mime-riff' into 'develop'
Mime: detect RIFF formats (wave, webp, avi) See merge request pleroma/pleroma!769
This commit is contained in:
commit
25a659d2dc
1 changed files with 9 additions and 1 deletions
|
@ -102,10 +102,18 @@ defmodule Pleroma.MIME do
|
|||
"audio/ogg"
|
||||
end
|
||||
|
||||
defp check_mime_type(<<0x52, 0x49, 0x46, 0x46, _::binary>>) do
|
||||
defp check_mime_type(<<"RIFF", _::binary-size(4), "WAVE", _::binary>>) do
|
||||
"audio/wav"
|
||||
end
|
||||
|
||||
defp check_mime_type(<<"RIFF", _::binary-size(4), "WEBP", _::binary>>) do
|
||||
"image/webp"
|
||||
end
|
||||
|
||||
defp check_mime_type(<<"RIFF", _::binary-size(4), "AVI.", _::binary>>) do
|
||||
"video/avi"
|
||||
end
|
||||
|
||||
defp check_mime_type(_) do
|
||||
@default
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue