diff options
author | hakabahitoyo <hakabahitoyo@example.com> | 2018-11-15 15:11:59 +0900 |
---|---|---|
committer | hakabahitoyo <hakabahitoyo@example.com> | 2018-11-15 15:11:59 +0900 |
commit | 8e707aba29921666a50878c39751cd53ee5cde7e (patch) | |
tree | 3ea939775429c2363fc4647a2eed9b6891461723 /lib | |
parent | ebe658c16976d7a1938a3a132027e5b438937f39 (diff) | |
download | pleroma-8e707aba29921666a50878c39751cd53ee5cde7e.tar.gz |
format
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/uploaders/mdii.ex | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/pleroma/uploaders/mdii.ex b/lib/pleroma/uploaders/mdii.ex index 0f68b0805..c5deaf73f 100644 --- a/lib/pleroma/uploaders/mdii.ex +++ b/lib/pleroma/uploaders/mdii.ex @@ -10,12 +10,11 @@ defmodule Pleroma.Uploaders.Mdii do {:ok, file_data} = File.read(path) File.rm!(path) - + extension = Regex.replace(~r/^image\//, content_type, "") query = "https://#{host_name}/mdii.cgi?#{extension}" - with {:ok, %{status_code: 200, body: body}} <- - @httpoison.post(query, file_data) do + with {:ok, %{status_code: 200, body: body}} <- @httpoison.post(query, file_data) do remote_file_name = body public_url = "https://#{host_name}/#{remote_file_name}.#{extension}" {:ok, public_url} |