summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Strizhakov <alex.strizhakov@gmail.com>2020-09-01 11:30:56 +0300
committerAlexander Strizhakov <alex.strizhakov@gmail.com>2020-09-02 09:04:23 +0300
commit5e8adf91b46c3f23ec423d53afccbb062df4a241 (patch)
tree0ddc69500b85565e35c8c3e3d5c0ff1336d635d7
parentc17d83cd7330d5c874f647a5224a3a130ed88fb0 (diff)
don't overwrite passed pool option in http clients
-rw-r--r--lib/pleroma/http/ex_aws.ex2
-rw-r--r--lib/pleroma/http/tzdata.ex4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/http/ex_aws.ex b/lib/pleroma/http/ex_aws.ex
index 2fe8beafc..c3f335c73 100644
--- a/lib/pleroma/http/ex_aws.ex
+++ b/lib/pleroma/http/ex_aws.ex
@@ -11,7 +11,7 @@ defmodule Pleroma.HTTP.ExAws do
@impl true
def request(method, url, body \\ "", headers \\ [], http_opts \\ []) do
- http_opts = Keyword.put(http_opts, :adapter, pool: :upload)
+ http_opts = Keyword.put_new(http_opts, :adapter, pool: :upload)
case HTTP.request(method, url, body, headers, http_opts) do
{:ok, env} ->
diff --git a/lib/pleroma/http/tzdata.ex b/lib/pleroma/http/tzdata.ex
index 7dd3352ff..356799aab 100644
--- a/lib/pleroma/http/tzdata.ex
+++ b/lib/pleroma/http/tzdata.ex
@@ -11,7 +11,7 @@ defmodule Pleroma.HTTP.Tzdata do
@impl true
def get(url, headers, options) do
- options = Keyword.put(options, :adapter, pool: :upload)
+ options = Keyword.put_new(options, :adapter, pool: :upload)
with {:ok, %Tesla.Env{} = env} <- HTTP.get(url, headers, options) do
{:ok, {env.status, env.headers, env.body}}
@@ -20,7 +20,7 @@ defmodule Pleroma.HTTP.Tzdata do
@impl true
def head(url, headers, options) do
- options = Keyword.put(options, :adapter, pool: :upload)
+ options = Keyword.put_new(options, :adapter, pool: :upload)
with {:ok, %Tesla.Env{} = env} <- HTTP.head(url, headers, options) do
{:ok, {env.status, env.headers}}