   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 =

  defp progress?(%{progress?: progress?}) do
    System.get_env("NERVES_LOG_DISABLE_PROGRESS_BAR") == nil and progress?
  end

  defp tuple_to_charlist({k, v}) do
    {to_charlist(k), to_charlist(v)}
  end
end
