Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
286f6698
Commit
286f6698
authored
Feb 04, 2018
by
eal
Browse files
Detect file type if none given.
parent
61c16193
Pipeline
#638
passed with stage
in 2 minutes and 14 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
lib/pleroma/upload.ex
View file @
286f6698
...
@@ -9,7 +9,7 @@ def store(%Plug.Upload{} = file) do
...
@@ -9,7 +9,7 @@ def store(%Plug.Upload{} = file) do
File
.
cp!
(
file
.
path
,
result_file
)
File
.
cp!
(
file
.
path
,
result_file
)
# fix content type on some image uploads
# fix content type on some image uploads
content_type
=
if
file
.
content_type
==
"application/octet-stream"
do
content_type
=
if
file
.
content_type
in
[
nil
,
"application/octet-stream"
]
do
get_content_type
(
file
.
path
)
get_content_type
(
file
.
path
)
else
else
file
.
content_type
file
.
content_type
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment