Mime: detect RIFF formats (wave, webp, avi)

This commit is contained in:
href 2019-02-04 17:44:41 +01:00
parent 28bfb09b01
commit 127f99ae18
No known key found for this signature in database
GPG Key ID: EE8296C1A152C325
1 changed files with 9 additions and 1 deletions

View File

@ -102,10 +102,18 @@ defp check_mime_type(<<0x4F, 0x67, 0x67, 0x53, 0x00, 0x02, 0x00, 0x00, _::binary
"audio/ogg" "audio/ogg"
end end
defp check_mime_type(<<0x52, 0x49, 0x46, 0x46, _::binary>>) do defp check_mime_type(<<"RIFF", _::binary-size(4), "WAVE", _::binary>>) do
"audio/wav" "audio/wav"
end 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 defp check_mime_type(_) do
@default @default
end end