     {:noreply, %{s | filename: "", content_length: 0, buffer: "", buffer_size: 0, url: nil}}
   end
 
-  def handle_info({:http, {_ref, {{_, status_code, reason}, headers, _body}}}, s)
-      when status_code in @redirect_status_codes do
-    case Enum.find(headers, fn {key, _} -> key == 'location' end) do
-      {'location', next_location} ->
-        handle_call({:get, List.to_string(next_location), headers: headers}, s.caller, %{
-          s
-          | buffer: "",
-            buffer_size: 0,
-            number_of_redirects: s.number_of_redirects + 1
-        })
-
-      _ ->
-        GenServer.reply(s.caller, {:error, format_error(status_code, reason)})
-    end
-  end
-
   def handle_info({:http, {_ref, {{_, status_code, reason}, _headers, _body}}}, s) do
     GenServer.reply(s.caller, {:error, format_error(status_code, reason)})
     {:noreply, s}

    ]

    http_opts =
      [timeout: :infinity, autoredirect: false]
      |> Keyword.merge(Nerves.Utils.Proxy.config(url))
      |> Keyword.merge(Keyword.get(opts, :http_opts, []))


       buffer_size: 0,
       filename: "",
       caller: nil,
       progress?: true,
       opts: []
     }}
  end

  def handle_call({:get, url, opts}, from, s) do
