You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: curl_helper.rb
    path of file: ./repos/vagrant/lib/vagrant/util
    
    the code of the file until where you have to start completion: # Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1

module Vagrant
  module Util
    class CurlHelper

      # Hosts that do not require notification on redirect
      SILENCED_HOSTS = [
        "vagrantcloud-files-production.s3-accelerate.amazonaws.com".freeze,
        "vagrantcloud.com".freeze,
        "vagrantup.com".freeze
      ].freeze

      def self.capture_output_proc(logger, ui, source=nil)
        progress_data = ""
        progress_
    
      def self.capture_output_proc(logger, ui, source=nil)
        progress_data = ""
        progress_regexp = /^\r\s*(\d.+?)\r/m

        # Setup the proc that'll receive the real-time data from
        # the downloader.
        data_proc = Proc.new do |type, data|
          # Type will always be "stderr" because that is the only
          # type of data we're subscribed for notifications.

          # Accumulate progress_data
          progress_data << data

          redirect_notify = false
          while true
            # If the download has been redirected and we are no longer downloading
            # from the original host, notify the user that the target host has
            # changed from the source.
            if progress_data.include?("Location")
              location = progress_data.scan(/(^|[^\w-])Location: (.+?)$/m).flatten.compact.last.to_s.strip
              if !location.empty?
                location_uri = URI.parse(location)

                if !location_uri.host.nil? && !redirect_notify
                  logger.info("download redirected to #{location}")
                  source_uri = URI.parse(source)
                  source_host = source_uri.host.to_s.split(".", 2).last
                  location_host = location_uri.host.to_s.split(".", 2).last
                  if location_host != source_host && !SILENCED_HOSTS.include?(location_host) && !SILENCED_HOSTS.include?(location_uri.host.to_s)
                    ui.rewriting do |_ui|
                      _ui.clear_line
                      _ui.detail "Download redirected to host: #{location_uri.host}"
                    end
                  end
                  redirect_notify = true
                end
              end
              progress_data.replace("")
              break
            end