projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make error message about author's inability to vote more sensible
[akkoma]
/
lib
/
pleroma
/
mime.ex
diff --git
a/lib/pleroma/mime.ex
b/lib/pleroma/mime.ex
index 2cb3d8bd15f940ecaa16f8e248c44035486054c8..36771533f01336c8331ebd7d989273437212228d 100644
(file)
--- a/
lib/pleroma/mime.ex
+++ b/
lib/pleroma/mime.ex
@@
-1,3
+1,7
@@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.MIME do
@moduledoc """
Returns the mime-type of a binary and optionally a normalized file-name.
defmodule Pleroma.MIME do
@moduledoc """
Returns the mime-type of a binary and optionally a normalized file-name.
@@
-98,10
+102,18
@@
defmodule Pleroma.MIME do
"audio/ogg"
end
"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
"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
defp check_mime_type(_) do
@default
end