logo

pleroma

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

hackney.ex (633B)


  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.ReverseProxy.Client.Hackney do
  5. @behaviour Pleroma.ReverseProxy.Client
  6. @impl true
  7. def request(method, url, headers, body, opts \\ []) do
  8. :hackney.request(method, url, headers, body, opts)
  9. end
  10. @impl true
  11. def stream_body(ref) do
  12. case :hackney.stream_body(ref) do
  13. :done -> :done
  14. {:ok, data} -> {:ok, data, ref}
  15. {:error, error} -> {:error, error}
  16. end
  17. end
  18. @impl true
  19. def close(ref), do: :hackney.close(ref)
  20. end