logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

ex_aws.ex (664B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.HTTP.ExAws do
  5. @moduledoc false
  6. @behaviour ExAws.Request.HttpClient
  7. alias Pleroma.HTTP
  8. @impl true
  9. def request(method, url, body \\ "", headers \\ [], http_opts \\ []) do
  10. http_opts = Keyword.put_new(http_opts, :pool, :upload)
  11. case HTTP.request(method, url, body, headers, http_opts) do
  12. {:ok, env} ->
  13. {:ok, %{status_code: env.status, headers: env.headers, body: env.body}}
  14. {:error, reason} ->
  15. {:error, %{reason: reason}}
  16. end
  17. end
  18. end