# fetch Hackney options
#
- defp hackney_options(opts) do
+ def hackney_options(opts) do
options = Keyword.get(opts, :adapter, [])
adapter_options = Pleroma.Config.get([:http, :adapter], [])
proxy_url = Pleroma.Config.get([:http, :proxy_url], nil)
end
def process_request_options(options) do
- case Pleroma.Config.get([:http, :proxy_url]) do
- nil -> options
- proxy -> options ++ [proxy: proxy]
- end
+ Keyword.merge(Pleroma.HTTP.Connection.hackney_options([]), options)
end
@doc """
* `http`: options for [hackney](https://github.com/benoitc/hackney).
"""
- @default_hackney_options []
+ @default_hackney_options [pool: :media]
@inline_content_types [
"image/gif",
def call(conn = %{method: method}, url, opts) when method in @methods do
hackney_opts =
- @default_hackney_options
+ Pleroma.HTTP.Connection.hackney_options([])
+ |> Keyword.merge(@default_hackney_options)
|> Keyword.merge(Keyword.get(opts, :http, []))
|> HTTP.process_request_options()