From 286f6698eee9127928ce945e73be2e1059ba4e81 Mon Sep 17 00:00:00 2001 From: eal Date: Sun, 4 Feb 2018 15:14:08 +0200 Subject: [PATCH] Detect file type if none given. --- lib/pleroma/upload.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.45.2