Sha256: 97d978805ca3857e85cf7e340d428e9664a476f6c950b8e62c103bf110015411

Contents?: true

Size: 682 Bytes

Versions: 32

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

class Puppet::Settings::HttpExtraHeadersSetting < Puppet::Settings::BaseSetting
  def type
    :http_extra_headers
  end

  def munge(headers)
    return headers if headers.is_a?(Hash)

    headers = headers.split(/\s*,\s*/) if headers.is_a?(String)

    raise ArgumentError, _("Expected an Array, String, or Hash, got a %{klass}") % { klass: headers.class } unless headers.is_a?(Array)

    headers.map! { |header|
      case header
      when String
        header.split(':')
      when Array
        header
      else
        raise ArgumentError, _("Expected an Array or String, got a %{klass}") % { klass: header.class }
      end
    }
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.10.0-x86-mingw32 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.10.0-x64-mingw32 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.10.0-universal-darwin lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.9.0 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.9.0-x86-mingw32 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.9.0-x64-mingw32 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.9.0-universal-darwin lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.8.1 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.8.1-x86-mingw32 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.8.1-x64-mingw32 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.8.1-universal-darwin lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.7.0 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.7.0-x86-mingw32 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.7.0-x64-mingw32 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.7.0-universal-darwin lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.6.0 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.6.0-x86-mingw32 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.6.0-x64-mingw32 lib/puppet/settings/http_extra_headers_setting.rb
puppet-8.6.0-universal-darwin lib/puppet/settings/http_extra_headers_setting.rb