projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'bugfix/webfinger-jrd' into 'develop'
[akkoma]
/
lib
/
pleroma
/
mime.ex
diff --git
a/lib/pleroma/mime.ex
b/lib/pleroma/mime.ex
index db8b7c742131035244ca2145ebc46953469c3591..2cb3d8bd15f940ecaa16f8e248c44035486054c8 100644
(file)
--- a/
lib/pleroma/mime.ex
+++ b/
lib/pleroma/mime.ex
@@
-3,7
+3,7
@@
defmodule Pleroma.MIME do
Returns the mime-type of a binary and optionally a normalized file-name.
"""
@default "application/octet-stream"
Returns the mime-type of a binary and optionally a normalized file-name.
"""
@default "application/octet-stream"
- @read_bytes 3
1
+ @read_bytes 3
5
@spec file_mime_type(String.t()) ::
{:ok, content_type :: String.t(), filename :: String.t()} | {:error, any()} | :error
@spec file_mime_type(String.t()) ::
{:ok, content_type :: String.t(), filename :: String.t()} | {:error, any()} | :error
@@
-33,10
+33,10
@@
defmodule Pleroma.MIME do
{:ok, check_mime_type(head)}
end
{:ok, check_mime_type(head)}
end
- def mime_type(<<_::binary>>), do: {:ok, @default}
-
def bin_mime_type(_), do: :error
def bin_mime_type(_), do: :error
+ def mime_type(<<_::binary>>), do: {:ok, @default}
+
defp fix_extension(filename, content_type) do
parts = String.split(filename, ".")
defp fix_extension(filename, content_type) do
parts = String.split(filename, ".")