Sha256: caa40d32ea277ccc42cd1cb9048e1821c6b150cf762df136f0eff0f159a26b43

Contents?: true

Size: 731 Bytes

Versions: 134

Compression:

Stored size: 731 Bytes

Contents

require 'puppet/file_serving/http_metadata'
require 'puppet/indirector/generic_http'
require 'puppet/indirector/file_metadata'
require 'net/http'

class Puppet::Indirector::FileMetadata::Http < Puppet::Indirector::GenericHttp
  desc "Retrieve file metadata from a remote HTTP server."

  include Puppet::FileServing::TerminusHelper

  @http_method = :head

  def find(request)
    head = super

    if head.is_a?(Net::HTTPSuccess)
      metadata = Puppet::FileServing::HttpMetadata.new(head)
      metadata.checksum_type = request.options[:checksum_type] if request.options[:checksum_type]
      metadata.collect
      metadata
    end
  end

  def search(request)
    raise Puppet::Error, "cannot lookup multiple files"
  end
end

Version data entries

134 entries across 134 versions & 2 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/indirector/file_metadata/http.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.12 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.12-x86-mingw32 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.12-x64-mingw32 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.12-universal-darwin lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.11 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.11-x86-mingw32 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.11-x64-mingw32 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.11-universal-darwin lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.10 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.10-x86-mingw32 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.10-x64-mingw32 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.10-universal-darwin lib/puppet/indirector/file_metadata/http.rb
puppet-retrospec-1.6.1 vendor/pup410/lib/puppet/indirector/file_metadata/http.rb
puppet-retrospec-1.6.0 vendor/pup410/lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.9 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.9-x86-mingw32 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.9-x64-mingw32 lib/puppet/indirector/file_metadata/http.rb
puppet-4.10.9-universal-darwin lib/puppet/indirector/file_metadata/http.rb