aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/http/adapter_helper/gun.ex17
-rw-r--r--lib/pleroma/pool/request.ex10
2 files changed, 4 insertions, 23 deletions
diff --git a/lib/pleroma/http/adapter_helper/gun.ex b/lib/pleroma/http/adapter_helper/gun.ex
index b3298ec7f..5d5870d90 100644
--- a/lib/pleroma/http/adapter_helper/gun.ex
+++ b/lib/pleroma/http/adapter_helper/gun.ex
@@ -26,7 +26,6 @@ defmodule Pleroma.HTTP.AdapterHelper.Gun do
@defaults
|> Keyword.merge(Pleroma.Config.get([:http, :adapter], []))
- |> add_original(uri)
|> add_scheme_opts(uri)
|> AdapterHelper.maybe_add_proxy(AdapterHelper.format_proxy(proxy))
|> maybe_get_conn(uri, connection_opts)
@@ -42,17 +41,12 @@ defmodule Pleroma.HTTP.AdapterHelper.Gun do
:ok
end
- defp add_original(opts, %URI{host: host, port: port}) do
- formatted_host = format_host(host)
-
- Keyword.put(opts, :original, "#{formatted_host}:#{port}")
- end
-
defp add_scheme_opts(opts, %URI{scheme: "http"}), do: opts
- defp add_scheme_opts(opts, %URI{scheme: "https", host: host, port: port}) do
+ defp add_scheme_opts(opts, %URI{scheme: "https", host: host}) do
adapter_opts = [
certificates_verification: true,
+ transport: :tls,
tls_opts: [
verify: :verify_peer,
cacertfile: CAStore.file_path(),
@@ -63,13 +57,6 @@ defmodule Pleroma.HTTP.AdapterHelper.Gun do
]
]
- adapter_opts =
- if port != 443 do
- Keyword.put(adapter_opts, :transport, :tls)
- else
- adapter_opts
- end
-
Keyword.merge(opts, adapter_opts)
end
diff --git a/lib/pleroma/pool/request.ex b/lib/pleroma/pool/request.ex
index cce309599..0f271b3d0 100644
--- a/lib/pleroma/pool/request.ex
+++ b/lib/pleroma/pool/request.ex
@@ -28,12 +28,7 @@ defmodule Pleroma.Pool.Request do
end
@impl true
- def handle_info({:gun_data, _conn, stream, _, _}, state) do
- # in some cases if we reuse conn and got {:error, :body_too_large}
- # gun continues to send messages to this process,
- # so we flush messages for this request
- :ok = :gun.flush(stream)
-
+ def handle_info({:gun_data, _conn, _stream, _, _}, state) do
{:noreply, state}
end
@@ -49,8 +44,7 @@ defmodule Pleroma.Pool.Request do
end
@impl true
- def handle_info({:gun_error, _conn, stream, _error}, state) do
- :ok = :gun.flush(stream)
+ def handle_info({:gun_error, _conn, _stream, _error}, state) do
{:noreply, state}
end