mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-10-31 14:01:17 +00:00
0cb7b0ea84
- partitial_chain is no longer exported, but it seems to be the default anyway. - The bug that caused sni to not be sent automatically seems to be fixed - https://github.com/benoitc/hackney/issues/612
29 lines
712 B
Elixir
29 lines
712 B
Elixir
defmodule Pleroma.HTTP.AdapterHelper.Hackney do
|
|
@behaviour Pleroma.HTTP.AdapterHelper
|
|
|
|
@defaults [
|
|
connect_timeout: 10_000,
|
|
recv_timeout: 20_000,
|
|
follow_redirect: true,
|
|
force_redirect: true,
|
|
pool: :federation
|
|
]
|
|
|
|
@spec options(keyword(), URI.t()) :: keyword()
|
|
def options(connection_opts \\ [], %URI{} = uri) do
|
|
proxy = Pleroma.Config.get([:http, :proxy_url])
|
|
|
|
config_opts = Pleroma.Config.get([:http, :adapter], [])
|
|
|
|
@defaults
|
|
|> Keyword.merge(config_opts)
|
|
|> Keyword.merge(connection_opts)
|
|
|> add_scheme_opts(uri)
|
|
|> Pleroma.HTTP.AdapterHelper.maybe_add_proxy(proxy)
|
|
end
|
|
|
|
defp add_scheme_opts(opts, _), do: opts
|
|
|
|
def after_request(_), do: :ok
|
|
end
|