1 defmodule Pleroma.HTTP.AdapterHelper.Hackney do
2 @behaviour Pleroma.HTTP.AdapterHelper
5 connect_timeout: 10_000,
12 @spec options(keyword(), URI.t()) :: keyword()
13 def options(connection_opts \\ [], %URI{} = uri) do
14 proxy = Pleroma.Config.get([:http, :proxy_url])
16 config_opts = Pleroma.Config.get([:http, :adapter], [])
19 |> Keyword.merge(config_opts)
20 |> Keyword.merge(connection_opts)
21 |> add_scheme_opts(uri)
22 |> Pleroma.HTTP.AdapterHelper.maybe_add_proxy(proxy)
25 defp add_scheme_opts(opts, _), do: opts
27 def after_request(_), do: :ok