Module: SecureHeaders::Configuration

Defined in:
lib/secure_headers.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.cspObject

Returns the value of attribute csp.



32
33
34
# File 'lib/secure_headers.rb', line 32

def csp
  @csp
end

.hpkpObject

Returns the value of attribute hpkp.



32
33
34
# File 'lib/secure_headers.rb', line 32

def hpkp
  @hpkp
end

.hstsObject

Returns the value of attribute hsts.



32
33
34
# File 'lib/secure_headers.rb', line 32

def hsts
  @hsts
end

.script_hashesObject

Returns the value of attribute script_hashes.



32
33
34
# File 'lib/secure_headers.rb', line 32

def script_hashes
  @script_hashes
end

.x_content_type_optionsObject

Returns the value of attribute x_content_type_options.



32
33
34
# File 'lib/secure_headers.rb', line 32

def x_content_type_options
  @x_content_type_options
end

.x_download_optionsObject

Returns the value of attribute x_download_options.



32
33
34
# File 'lib/secure_headers.rb', line 32

def x_download_options
  @x_download_options
end

.x_frame_optionsObject

Returns the value of attribute x_frame_options.



32
33
34
# File 'lib/secure_headers.rb', line 32

def x_frame_options
  @x_frame_options
end

.x_permitted_cross_domain_policiesObject

Returns the value of attribute x_permitted_cross_domain_policies.



32
33
34
# File 'lib/secure_headers.rb', line 32

def x_permitted_cross_domain_policies
  @x_permitted_cross_domain_policies
end

.x_xss_protectionObject

Returns the value of attribute x_xss_protection.



32
33
34
# File 'lib/secure_headers.rb', line 32

def x_xss_protection
  @x_xss_protection
end

Class Method Details

.configure(&block) ⇒ Object



36
37
38
39
40
41
# File 'lib/secure_headers.rb', line 36

def configure &block
  instance_eval &block
  if File.exists?(SCRIPT_HASH_CONFIG_FILE)
    ::SecureHeaders::Configuration.script_hashes = YAML.load(File.open(SCRIPT_HASH_CONFIG_FILE))
  end
end