class Gem::CompactIndexClient::HTTPFetcher

Fetches compact index files relative to base_uri using Gem::RemoteFetcher‘s connection infrastructure (proxy, TLS, connection pooling). Implements the fetcher interface expected by Gem::CompactIndexClient: call(path, headers) returning a Gem::Net::HTTP response.

Public Class Methods

# File lib/rubygems/compact_index_client/http_fetcher.rb, line 15
def initialize(base_uri, remote_fetcher = Gem::RemoteFetcher.fetcher)
  base_uri = base_uri.to_s
  base_uri += "/" unless base_uri.end_with?("/")
  @base_uri = Gem::URI(base_uri)
  @remote_fetcher = remote_fetcher
end

Public Instance Methods

# File lib/rubygems/compact_index_client/http_fetcher.rb, line 22
def call(path, headers = {})
  fetch(@base_uri + path, headers, REDIRECT_LIMIT)
end