From: eal Date: Sun, 4 Feb 2018 13:14:08 +0000 (+0200) Subject: Detect file type if none given. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=286f6698eee9127928ce945e73be2e1059ba4e81;p=akkoma Detect file type if none given. --- diff --git a/lib/pleroma/upload.ex b/lib/pleroma/upload.ex index 3567c6c88..c41617c68 100644 --- a/lib/pleroma/upload.ex +++ b/lib/pleroma/upload.ex @@ -9,7 +9,7 @@ defmodule Pleroma.Upload do File.cp!(file.path, result_file) # 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) else file.content_type