From: rinpatch Date: Sat, 5 Sep 2020 18:17:03 +0000 (+0300) Subject: ConnectionPool middleware: fix a crash due to unimplemented behaviour X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=5298de3be6683022fa53cc011dd567e8b2a706b9;p=akkoma ConnectionPool middleware: fix a crash due to unimplemented behaviour Structs don't implement Access behaviour, so this crashed. Tests didn't catch it and I didn't test that part of the codepath. Very sorry --- diff --git a/lib/pleroma/tesla/middleware/connection_pool.ex b/lib/pleroma/tesla/middleware/connection_pool.ex index 5909e98d6..049db6eb3 100644 --- a/lib/pleroma/tesla/middleware/connection_pool.ex +++ b/lib/pleroma/tesla/middleware/connection_pool.ex @@ -32,7 +32,7 @@ defmodule Pleroma.Tesla.Middleware.ConnectionPool do {:ok, env} -> unless opts[:adapter][:body_as] == :chunks do ConnectionPool.release_conn(conn_pid) - {:ok, pop_in(env[:opts][:adapter][:conn])} + {:ok, pop_in(env.opts[:adapter][:conn])} else {:ok, env} end