lib/secure_headers/headers/referrer_policy.rb
# Public: generate an Referrer Policy header.
#
# Returns a default header if no configuration is provided, or a
# header name and value based on the config.
generate an Referrer Policy header.
Returns a default header if no configuration is provided, or a
header name and value based on the config.
generate an Referrer Policy header . Returns a default header if no configuration is provided or a header name and value based on the config .
def validate_config!(config)
        case config
        when nil, OPT_OUT
        when String, Array
          config = Array(config)
          unless config.all? { |t| t.is_a?(String) && VALID_POLICIES.include?(t.downcase) }
            raise ReferrerPolicyConfigError.new("Value can only be one or more of #{VALID_POLICIES.join(", ")}")
          end
        else
          raise TypeError.new("Must be a string or array of strings. Found #{config.class}: #{config}")
        end
      end
def validate_config! ( config ) case config when nil , OPT_OUT when String , Array config = Array ( config ) unless config . all? { | t | t . is_a? ( String ) && VALID_POLICIES . include? ( t . downcase ) } raise ReferrerPolicyConfigError . new ( "Value can only be one or more of #{VALID_POLICIES.join(", ")}" ) end else raise TypeError . new ( "Must be a string or array of strings. Found #{config.class}: #{config}" ) end end
Public: generate an Referrer Policy header.
Public : generate an Referrer Policy header .
# valid
config