Skip to content

Commit

Permalink
fix: ensure adapter is set
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis committed Oct 21, 2024
1 parent 98d6a65 commit a446282
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/tesla.ex
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ defmodule Tesla do
end

defp prepare(module, %{pre: pre, post: post} = client, options) do
env = struct(Env, options ++ [__module__: module, __client__: client])
stack = pre ++ module.__middleware__() ++ post ++ [effective_adapter(module, client)]
adapter = effective_adapter(module, client)
env = struct(Env, options ++ [__module__: module, __client__: %{client | adapter: adapter}])
stack = pre ++ module.__middleware__() ++ post ++ [adapter]
{env, stack}
end

Expand Down

0 comments on commit a446282

Please sign in to comment.