   use GenServer
 
   @progress_steps 50
-  @redirect_status_codes [301, 302, 303, 307, 308]
 
   def start_link() do
     {:ok, _} = Application.ensure_all_started(:nerves)

  def handle_call({:get, url, opts}, from, s) do
    progress? = Keyword.get(opts, :progress?, true)

    headers =
      Keyword.get(opts, :headers, [])
      |> Enum.map(fn {k, v} ->
        {to_charlist(k), to_charlist(v)}
      end)

    headers = [
      {'User-Agent', 'Nerves HTTP Client #{Nerves.version()}'},
      {'Content-Type', 'application/octet-stream'} | headers
    ]

    http_opts =

  end

  def handle_info({:http, {_ref, {{_, status_code, reason}, headers, _body}}}, s)
      when div(status_code, 100) == 3 do
    case Enum.find(headers, fn {key, _} -> key == 'location' end) do
      {'location', next_location} ->
        next_get_opts = Keyword.drop(s.get_opts, [:headers])

        handle_call({:get, List.to_string(next_location), next_get_opts}, s.caller, %{
          s
          | buffer: "",
            buffer_size: 0,
