# File lib/net/ping/http.rb, line 69
    def ping(host = @host)
      super(host)
      bool = false

      # See https://bugs.ruby-lang.org/issues/8645
      host = "http://#{host}" unless host.include?("http")

      uri = URI.parse(host)

      start_time = Time.now

      response = do_ping(uri)

      if response.is_a?(Net::HTTPSuccess)
        bool = true
      elsif redirect?(response) # Check code, HTTPRedirection does not always work
        if @follow_redirect
          @warning = response.message
          rlimit   = 0

          while redirect?(response)
            if rlimit >= redirect_limit
              @exception = "Redirect limit exceeded"
              break
            end
            redirect = URI.parse(response['location'])
            redirect = uri + redirect if redirect.relative?
            response = do_ping(redirect)
            rlimit   += 1
          end

          if response.is_a?(Net::HTTPSuccess)
            bool = true
          else
            @warning   = nil
            @exception ||= response.message
          end

        else
          @exception = response.message
        end
      end

      # There is no duration if the ping failed
      @duration = Time.now - start_time if bool

      bool
    end