mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-23 09:44:52 +00:00
Allow Pleroma.HTTP to connect to raw-HTTP without freaking mint out
This commit is contained in:
parent
8670d89316
commit
31d7cc9a9c
|
@ -269,7 +269,6 @@ defmodule Pleroma.Application do
|
||||||
|> Config.get([])
|
|> Config.get([])
|
||||||
|> Pleroma.HTTP.AdapterHelper.add_pool_size(pool_size)
|
|> Pleroma.HTTP.AdapterHelper.add_pool_size(pool_size)
|
||||||
|> Pleroma.HTTP.AdapterHelper.maybe_add_proxy_pool(proxy)
|
|> Pleroma.HTTP.AdapterHelper.maybe_add_proxy_pool(proxy)
|
||||||
|> Pleroma.HTTP.AdapterHelper.maybe_add_cacerts(:public_key.cacerts_get())
|
|
||||||
|> Keyword.put(:name, MyFinch)
|
|> Keyword.put(:name, MyFinch)
|
||||||
|
|
||||||
[{Finch, config}]
|
[{Finch, config}]
|
||||||
|
|
|
@ -62,6 +62,13 @@ defmodule Pleroma.HTTP do
|
||||||
uri = URI.parse(url)
|
uri = URI.parse(url)
|
||||||
adapter_opts = AdapterHelper.options(uri, options || [])
|
adapter_opts = AdapterHelper.options(uri, options || [])
|
||||||
|
|
||||||
|
adapter_opts =
|
||||||
|
if uri.scheme == :https do
|
||||||
|
AdapterHelper.maybe_add_cacerts(adapter_opts, :public_key.cacerts_get())
|
||||||
|
else
|
||||||
|
adapter_opts
|
||||||
|
end
|
||||||
|
|
||||||
options = put_in(options[:adapter], adapter_opts)
|
options = put_in(options[:adapter], adapter_opts)
|
||||||
params = options[:params] || []
|
params = options[:params] || []
|
||||||
request = build_request(method, headers, options, url, body, params)
|
request = build_request(method, headers, options, url, body, params)
|
||||||
|
|
Loading…
Reference in a new issue