lib/secure_headers.rb
# Public: Retreives the config for a given header type:
#
# Checks to see if there is an override for this request, then
# Checks to see if a named override is used for this request, then
# Falls back to the global config
Retreives the config for a given header type:
Checks to see if there is an override for this request, then
Checks to see if a named override is used for this request, then
Falls back to the global config
Retreives the config for a given header type : Checks to see if there is an override for this request then Checks to see if a named override is used for this request then Falls back to the global config
def config_for(request, prevent_dup = false)
      config = request.env[SECURE_HEADERS_CONFIG] ||
        Configuration.send(:default_config)
      if config.frozen? && !prevent_dup
        config.dup
      else
        config
      end
    end
def config_for ( request , prevent_dup = false ) config = request . env [ SECURE_HEADERS_CONFIG ] || Configuration . send ( :default_config ) if config . frozen? && ! prevent_dup config . dup else config end end
Public: Retreives the config for a given header type:
Checks to see if there is an override for this request, then
Checks to see if a named override is used for this request, then
Falls back to the global config
Public : Retreives the config for a given header type : Checks to see if there is an override for this request then Checks to see if a named override is used for this request then Falls back to the global config
# Global configs are frozen, per-request configs are not. When we're not # making modifications to the config, prevent_dup ensures we don't dup # the object unnecessarily. It's not necessarily frozen to begin with.
request
prevent_dup