aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-25 10:14:19 +0000
committerlain <lain@soykaf.club>2020-06-25 10:14:19 +0000
commit1cd1977c0f894eaeaf7aed35c86a5fa0d21b3592 (patch)
tree4b6ef1de0b2cd73b827d094b72628bf58010de7b /lib
parent0e26ef2ab9061f51589fdb5149dee457203305e5 (diff)
parent439a1a0218fe032ac35bb2e84516a8a4bf8563b4 (diff)
downloadpleroma-1cd1977c0f894eaeaf7aed35c86a5fa0d21b3592.tar.gz
Merge branch 'issue/1872-ex_aws' into 'develop'
[#1872] use Pleroma.HTTP for ExAws.S3 See merge request pleroma/pleroma!2683
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/http/ex_aws.ex22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/pleroma/http/ex_aws.ex b/lib/pleroma/http/ex_aws.ex
new file mode 100644
index 000000000..e53e64077
--- /dev/null
+++ b/lib/pleroma/http/ex_aws.ex
@@ -0,0 +1,22 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.HTTP.ExAws do
+ @moduledoc false
+
+ @behaviour ExAws.Request.HttpClient
+
+ alias Pleroma.HTTP
+
+ @impl true
+ def request(method, url, body \\ "", headers \\ [], http_opts \\ []) do
+ case HTTP.request(method, url, body, headers, http_opts) do
+ {:ok, env} ->
+ {:ok, %{status_code: env.status, headers: env.headers, body: env.body}}
+
+ {:error, reason} ->
+ {:error, %{reason: reason}}
+ end
+ end
+end