diff --git a/lib/req/request.ex b/lib/req/request.ex index 6f18a940..d7e2fde0 100644 --- a/lib/req/request.ex +++ b/lib/req/request.ex @@ -371,7 +371,6 @@ defmodule Req.Request do error_steps: [], private: %{}, registered_options: MapSet.new(), - current_request_steps: [], into: nil, async: nil @@ -614,8 +613,7 @@ defmodule Req.Request do def append_request_steps(request, steps) do %{ request - | request_steps: request.request_steps ++ steps, - current_request_steps: request.current_request_steps ++ Keyword.keys(steps) + | request_steps: request.request_steps ++ steps } end @@ -632,8 +630,7 @@ defmodule Req.Request do def prepend_request_steps(request, steps) do %{ request - | request_steps: steps ++ request.request_steps, - current_request_steps: Keyword.keys(steps) ++ request.current_request_steps + | request_steps: steps ++ request.request_steps } end @@ -969,12 +966,10 @@ defmodule Req.Request do """ def run_request(request) - def run_request(%{current_request_steps: [step | rest]} = request) do - step = Keyword.fetch!(request.request_steps, step) - + def run_request(%{request_steps: [{_name, step} | rest]} = request) do case step.(request) do %Req.Request{} = request -> - run_request(%{request | current_request_steps: rest}) + run_request(%{request | request_steps: rest}) {%Req.Request{halted: true} = request, response_or_exception} -> {request, response_or_exception} @@ -987,7 +982,7 @@ defmodule Req.Request do end end - def run_request(%{current_request_steps: []} = request) do + def run_request(%{request_steps: []} = request) do case request.adapter.(request) do {request, %Req.Response{} = response} -> run_response(request, response)