aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhakabahitoyo <hakabahitoyo@example.com>2018-11-15 15:11:59 +0900
committerhakabahitoyo <hakabahitoyo@example.com>2018-11-15 15:11:59 +0900
commit8e707aba29921666a50878c39751cd53ee5cde7e (patch)
tree3ea939775429c2363fc4647a2eed9b6891461723
parentebe658c16976d7a1938a3a132027e5b438937f39 (diff)
downloadpleroma-8e707aba29921666a50878c39751cd53ee5cde7e.tar.gz
format
-rw-r--r--config/config.exs3
-rw-r--r--lib/pleroma/uploaders/mdii.ex5
2 files changed, 3 insertions, 5 deletions
diff --git a/config/config.exs b/config/config.exs
index ef69368e6..f222c1aa4 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -23,8 +23,7 @@ config :pleroma, Pleroma.Uploaders.S3,
public_endpoint: "https://s3.amazonaws.com",
force_media_proxy: false
-config :pleroma, Pleroma.Uploaders.Mdii,
- host_name: "mdii.sakura.ne.jp"
+config :pleroma, Pleroma.Uploaders.Mdii, host_name: "mdii.sakura.ne.jp"
config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"]
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}